lhotari opened a new pull request, #24700:
URL: https://github.com/apache/pulsar/pull/24700

   Fixes #23845
   Fixes #24490
   
   ### Motivation
   
   There a race condition in `PersistentDispatcherMultipleConsumers` where 
reading more entries might get skipped or delayed when there's a send in 
progress and new permits get added.  The race condition is explained in 
https://github.com/apache/pulsar/issues/23845#issuecomment-2599470326.
   
   Besides causing consuming to get stuck, the race condition could also cause 
latency delays and could be contributing to #24490.
   
   ### Modifications
   
   - add a flag `moreEntriesRequestedWhileSendInProgress` for detecting and 
resolving the race condition
     - the flag is set when `readMoreEntries` gets blocked by `sendInProgress`
     - if the flag is set, `handleSendingMessagesAndReadingMore` will always 
result in calling `readMoreEntries`
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update 
later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->


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