You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] POP consumers occasionally wait for the polling timeout despite available messages #11600
POP consumers can occasionally wait for the long-polling timeout even though a message is already readable. An arrival notification can run after a request checks for messages but before it enters the waiting queue. With no registered waiter, the notification is lost; the existing rest-count check still uses the earlier empty-read result. A subsequent arrival or the timeout sweep wakes the request. The same check-to-registration race exists in ordinary/KV POP, Notification, Lite Notification and Lite POP.
Steps to Reproduce
Invoke the broker processor with pollTime greater than zero and storage initially returning no message; do not start the polling timeout sweep.
Pause the request immediately before its waiting-queue add operation inserts the request.
Make the message readable (or enqueue the Lite event) and invoke the normal arrival notification while the queue still has no waiter.
Release registration and check whether the processor returns the message or a Notification response with hasMsg=true.
For comparison, publish after registration: the existing arrival path wakes the request normally.
What Did You Expect to See?
An arrival between the message check and polling registration should trigger another eligibility check rather than be forgotten.
What Did You See Instead?
The request remains suspended despite the readable message. With no further arrival it waits for the polling timeout. In an initial component reproduction with a 1-second polling timeout, the response arrived roughly 953-977 ms after publication. Deterministic tests against the current develop processors fail without a timeout sweep.
Additional Context
Unlike #8472, this also occurs with an empty queue and no filtering backlog: the message arrives after the empty read, so restNum remains zero. Queue removal/eviction (#11433) and notifications published before storage visibility (#11272) are separate problems.
Activity