f1amingo opened a new issue, #11600:
URL: https://github.com/apache/rocketmq/issues/11600

   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question.
   - [x] I have searched the GitHub Issues and Discussions and believe this is 
not a duplicate.
   - [x] I have confirmed this bug belongs to the current repository.
   
   ### Runtime platform environment
   
   macOS, reproduced with broker components and mocked storage/network 
dependencies.
   
   ### RocketMQ version
   
   develop, becbe78b1eaacf3002051e1bff76444e641e6c7e.
   
   ### JDK Version
   
   Azul Zulu OpenJDK 8u462.
   
   ### Describe the Bug
   
   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
   
   1. Invoke the broker processor with pollTime greater than zero and storage 
initially returning no message; do not start the polling timeout sweep.
   2. Pause the request immediately before its waiting-queue add operation 
inserts the request.
   3. Make the message readable (or enqueue the Lite event) and invoke the 
normal arrival notification while the queue still has no waiter.
   4. Release registration and check whether the processor returns the message 
or a Notification response with hasMsg=true.
   5. 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to