aloyszhang commented on a change in pull request #7078: URL: https://github.com/apache/pulsar/pull/7078#discussion_r432435725
########## File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PublishRateLimiter.java ########## @@ -66,6 +69,83 @@ * @param clusterName */ void update(PublishRate maxPublishRate); + + /** + * try to acquire permit + * @param numbers + * @param bytes + * */ + boolean tryAcquire(int numbers, long bytes); +} + +class PrecisPublishLimiter implements PublishRateLimiter { + protected volatile int publishMaxMessageRate = 0; Review comment: @merlimat There will be barely concurrent update of these fields, so I think volatile here is ok. Do you suggest to remove it ? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org