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/08/02 02:04:20 UTC

[GitHub] [pulsar] lordcheng10 commented on a diff in pull request #16408: [fix][broker] Support loadBalancerSheddingIntervalMinutes dynamic configuration

lordcheng10 commented on code in PR #16408:
URL: https://github.com/apache/pulsar/pull/16408#discussion_r935049132


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadSheddingTask.java:
##########
@@ -39,6 +51,24 @@ public void run() {
             loadManager.get().doLoadShedding();
         } catch (Exception e) {
             LOG.warn("Error during the load shedding", e);
+        } finally {
+            if (!isCancel) {
+                loadManagerExecutor.schedule(
+                        new LoadSheddingTask(loadManager, loadManagerExecutor, config),
+                        config.getLoadBalancerSheddingIntervalMinutes(),
+                        TimeUnit.MILLISECONDS);
+            }
         }
     }
+
+    public void start() {
+        loadManagerExecutor.schedule(
+                new LoadSheddingTask(loadManager, loadManagerExecutor, config),
+                config.getLoadBalancerSheddingIntervalMinutes(),
+                TimeUnit.MILLISECONDS);

Review Comment:
   fixed. PTAL,thanks! @Jason918 



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/LoadSheddingTask.java:
##########
@@ -39,6 +51,24 @@ public void run() {
             loadManager.get().doLoadShedding();
         } catch (Exception e) {
             LOG.warn("Error during the load shedding", e);
+        } finally {
+            if (!isCancel) {
+                loadManagerExecutor.schedule(
+                        new LoadSheddingTask(loadManager, loadManagerExecutor, config),
+                        config.getLoadBalancerSheddingIntervalMinutes(),
+                        TimeUnit.MILLISECONDS);

Review Comment:
   fixed. PTAL,thanks! @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