abhishekagarwal87 commented on code in PR #14880:
URL: https://github.com/apache/druid/pull/14880#discussion_r1301009263


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/SingleTaskBackgroundRunner.java:
##########
@@ -185,6 +186,10 @@ public void stop()
       // stopGracefully for resource cleaning
       log.info("Starting graceful shutdown of task[%s].", task.getId());
       task.stopGracefully(taskConfig);
+      // Only certain tasks, primarily from unit tests, are not subclasses of 
AbstractTask.
+      if (task instanceof AbstractTask) {
+        ((AbstractTask) task).waitForCleanupToFinish();
+      }

Review Comment:
   why bake that assumption into the code?  This class shouldn't be aware of 
what an `AbstractTask` is. If required, you should add a method to `Task` 
interface like `waitForTermination` and put the contract in the interface 
clearly how should that be implemented and how should it be called. 



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