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


##########
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:
   The time unit seems wrong.



##########
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:
   Same here.



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