sumitagrawl commented on code in PR #6179:
URL: https://github.com/apache/ozone/pull/6179#discussion_r1481197368


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancer.java:
##########
@@ -342,10 +342,13 @@ private static void blockTillTaskStop(Thread 
balancingThread) {
     // NOTE: join should be called outside the lock in hierarchy
     // to avoid locking others waiting
     // wait for balancingThread to die with interrupt
-    balancingThread.interrupt();
     LOG.info("Container Balancer waiting for {} to stop", balancingThread);
     try {
-      balancingThread.join();
+      while (balancingThread.isAlive()) {

Review Comment:
   @sodonnel 
   yes, thread will get interrupted as as soon it goes for sleep. Tested.
   Here, issue is,
   - before thread actually schedule to run, and if there is interrupt, that 
gets ignored.
   
   @Tejaskriya we can revert loop, but can add a check in run() before going 
for sleep for the delay, isBalancerRunning(). That will be case where it can 
ignore interrupt and go for sleep for 5 min as startup delay.
   



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