danielsinai opened a new pull request #11446:
URL: https://github.com/apache/pulsar/pull/11446


   ## Master Issue: #11351
   
   ### Motivation
   
   This PR is fixing the 1,2 problems as described in #11351.
   
   There was a bigger Pull request that I published #11352, but I closed it in 
due to being too big and lacked explaination for what is actually solves
   
   ### Reproduce
   - Allow precise rate limiting
   - Create a topic
   - Limit publish rate of messages per second to 10
   - With producer perf write 100 messages per second
   
     Results after this PR:
      
   
![image](https://user-images.githubusercontent.com/51213812/126812923-91bb827c-246d-451d-8f25-343bb2c1dca0.png)
   
   befoe this PR precise publishRate limiting wasn't taking effect at all
   ### Modifications
   
   In order to solve the current problems, there are 2 modifications
   
   1. Using IsDispatchRateLimiting in precise publish rate limiter as well (in 
order to starve the producer)
   2. Checking if there are available permits before resetting the read from 
the connection again
   
   ### Verifying this change
   
   Already covered by current tests.
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies  no
     - The public API: no
     - The schema:  no
     - The default values of configurations: no
     - The wire protocol: no
     - The rest endpoints: no
     - The admin cli options: no
     - Anything that affects deployment: no 
   
   ### Documentation
   
   #### For contributor
   
   For this PR, do we need to update docs? Probably not, it is just fixing the 
current implementation


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