You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/01 05:54:55 UTC

[GitHub] [pulsar] AnonHxy commented on a diff in pull request #15825: [fix][broker]Fix topic-level replicator rate limiter not init

AnonHxy commented on code in PR #15825:
URL: https://github.com/apache/pulsar/pull/15825#discussion_r886341619


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java:
##########
@@ -704,10 +704,19 @@ public Optional<DispatchRateLimiter> getRateLimiter() {
     }
 
     @Override
-    public void initializeDispatchRateLimiterIfNeeded() {
+    public boolean initializeDispatchRateLimiterIfNeeded() {
         if (!dispatchRateLimiter.isPresent()
             && DispatchRateLimiter.isDispatchRateEnabled(topic.getReplicatorDispatchRate())) {
             this.dispatchRateLimiter = Optional.of(new DispatchRateLimiter(topic, Type.REPLICATOR));
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public void updateRateLimiter() {

Review Comment:
   Yes, I have updated the code to synchronize `initializeDispatchRateLimiterIfNeeded` and `updateRateLimiter`. PTAL again @Jason918 ~



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org