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

   ### Motivation
   
   When multiple topics share a global consumer dispatch limiter, the old 
implementation could overshoot the rate limit. 
   Previously, the dispatcher would first determine how many tokens to acquire, 
send messages, and then deduct tokens in bulk after dispatch. 
   With multiple topics, this allowed each topic to acquire the same tokens 
concurrently, exceeding the actual limit. 
   We want to strictly enforce the dispatch rate to avoid bursts and maintain 
predictable throughput.
   
   ### Modifications
   
   - Refactored consumer dispatch to consume rate-limiting tokens before 
sending messages, ensuring that the total messages and bytes do not exceed 
available tokens.
   
   ### 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