ChenSammi commented on code in PR #9185:
URL: https://github.com/apache/ozone/pull/9185#discussion_r2498425103


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/BackgroundService.java:
##########
@@ -116,9 +135,20 @@ public synchronized void start() {
     if (exec == null || exec.isShutdown() || exec.isTerminated()) {
       initExecutorAndThreadGroup();
     }
-    LOG.info("Starting service {} with interval {} {}", serviceName,
-        interval, unit.name().toLowerCase());
-    exec.scheduleWithFixedDelay(service, 0, interval, unit);
+    
+    if (schedulingMode == SchedulingMode.FIXED_DELAY) {
+      LOG.info("Starting service {} with fixed delay {} {} after task 
completion", 
+          serviceName, interval, unit.name().toLowerCase());
+      // Use minimal delay for scheduleWithFixedDelay, actual interval 
controlled in run()
+      exec.scheduleWithFixedDelay(service, 0, 1, TimeUnit.MILLISECONDS);

Review Comment:
   We should use the real interval and unit 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to