xichen01 commented on code in PR #9595:
URL: https://github.com/apache/ozone/pull/9595#discussion_r2682859611
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/BackgroundService.java:
##########
@@ -118,7 +120,7 @@ public synchronized void start() {
}
LOG.info("Starting service {} with interval {} {}", serviceName,
interval, unit.name().toLowerCase());
- exec.scheduleWithFixedDelay(service, 0, interval, unit);
+ scheduler.scheduleWithFixedDelay(service, 0, interval, unit);
Review Comment:
`PeriodicalTask#run` is now a blocking method. If `exec` only has one
thread, when the `PeriodicalTask#run` blocks, Then the task submitted to the
queue will remain without a thread to execute it.
Therefore, we introduce a separate thread `scheduler` responsible for
submitting tasks, while `exec` is only responsible for executing the tasks.
--
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]