aryangupta1998 commented on code in PR #8391:
URL: https://github.com/apache/ozone/pull/8391#discussion_r2094660207
##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/BackgroundService.java:
##########
@@ -103,8 +105,21 @@ public void runPeriodicalTaskNow() throws Exception {
}
// start service
- public void start() {
- exec.scheduleWithFixedDelay(service, 0, interval, unit);
+ public synchronized void start() {
+ scheduledHandle = exec.scheduleWithFixedDelay(service, 0, interval, unit);
Review Comment:
Should we also add a check to not start the thread if scheduledHandle is not
null?
cc @sumitagrawl
--
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]