swamirishi commented on code in PR #9382:
URL: https://github.com/apache/ozone/pull/9382#discussion_r2568482554


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/BackgroundService.java:
##########
@@ -162,7 +165,9 @@ public void run() {
       if (LOG.isDebugEnabled()) {
         LOG.debug("Number of background tasks to execute : {}", tasks.size());
       }
-      synchronized (BackgroundService.this) {
+
+      try {
+        semaphore.acquire();

Review Comment:
   No this would be a problem because the shutdown thread would wait for the 
threads to finish for the tasks already present in the queue of the 
threadPoolExecutor. Those have to finish first. Right now the shutdown function 
would always end up doing a force shutdown if the interval is small enough. 
   This wait would happen unnecessarily everytime.
   
https://github.com/apache/ozone/blob/c42fc3aae470e4ac4ac29298a5c03c824d18bae7/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/BackgroundService.java#L198-L200
   



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