f1amingo opened a new pull request, #11251:
URL: https://github.com/apache/rocketmq/pull/11251

   ### Which Issue(s) This PR Fixes
   
   - Fixes #11250
   
   ### Brief Description
   
   When acking a lite message, the broker re-dispatched the lite topic while 
still holding its pop lock. A pop that took the re-dispatched event before the 
lock was released failed to acquire the lock and skipped the lite topic, and 
the event was already consumed, so the remaining messages could stay 
undelivered.
   
   This PR keeps the offset commit and the block check under the lock, and 
performs the dispatch after the lock is released. A dispatch that turns out to 
be stale is harmless: the pop reads 0 messages or finds the lite topic 
FIFO-blocked.
   
   ### How Did You Test This Change?
   
   Added `testAckLite_dispatchAfterUnlock` to `AckMessageProcessorTest`, which 
asserts the pop lock can be acquired when the ack dispatches; it fails on the 
current code and passes with the fix. `AckMessageProcessorTest`, 
`PopLiteMessageProcessorTest`, `PopLiteMessageProcessorEventLossTest` and 
`LiteEventDispatcherTest` pass.
   


-- 
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