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

   
   ### Motivation
   
   When publish rate limiting is disabled (for example by clearing the publish 
rate policy so update(null) is called), token buckets are nulled out 
immediately, but producers that were already throttled could remain blocked 
until a previously scheduled unthrottle task ran. That delayed task may have 
been scheduled with a very long wait time when the token bucket was deeply 
depleted, so disabling the limit in configuration did not restore traffic 
quickly. This change triggers the existing lock-free unthrottle path right away 
after disablement when an executor was already cached from a prior throttle on 
this limiter.
   
   ### Modifications
   
   - In PublishRateLimiterImpl, cache the ScheduledExecutorService used when 
scheduling unthrottleQueuedProducers after the first throttling event on this 
limiter instance.
   - When update(PublishRate) is called with a null PublishRate (rate limiting 
disabled), call scheduleUnthrottling(cachedExecutor, 0) so queued producers are 
processed without waiting on the old delayed task.
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   
   ### Does this pull request potentially affect one of the following parts:
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   *If the box was checked, please highlight the changes*
   
   - [ ] Dependencies (add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment


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