eolivelli commented on a change in pull request #10384:
URL: https://github.com/apache/pulsar/pull/10384#discussion_r623919273



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/PrecisPublishLimiter.java
##########
@@ -71,31 +80,63 @@ public void update(Policies policies, String clusterName) {
                 : null;
         this.update(maxPublishRate);
     }
+
     public void update(PublishRate maxPublishRate) {
-        if (maxPublishRate != null

Review comment:
       can we exit in case that previous `maxPublishRate` is the same as the 
current one ?
   this way we will save resources

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/nonpersistent/NonPersistentTopic.java
##########
@@ -425,6 +425,13 @@ public void removeProducer(Producer producer) {
 
         replicators.forEach((cluster, replicator) -> 
futures.add(replicator.disconnect()));
         producers.values().forEach(producer -> 
futures.add(producer.disconnect()));
+        if (topicPublishRateLimiter instanceof AutoCloseable) {

Review comment:
       why can't we make every instance of topicPublishRateLimiter  implement 
`AutoCloseable` ?




-- 
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:
[email protected]


Reply via email to