jon-wei commented on a change in pull request #8236: Add TaskResourceCleaner;
fix a couple of concurrency bugs in batch tasks
URL: https://github.com/apache/incubator-druid/pull/8236#discussion_r311335172
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/common/task/Task.java
##########
@@ -162,12 +162,15 @@ default int getPriority()
/**
* Asks a task to arrange for its "run" method to exit promptly. Tasks that
take too long to stop gracefully will be
- * terminated with extreme prejudice.
+ * terminated with extreme prejudice. Note that this method can be called at
any time while {@link #run} is called.
+ * Its implementations should handle potential concurreny issues properly.
*
- * If the task has some resources to clean up on exit, e.g., sub tasks of
parallel indexing task
- * or Hadoop job of Hadoop indexing task, those resource cleanups should be
done in this method.
+ * If the task has some resources to clean up on exit, e.g., sub tasks of
parallel indexing task or Hadoop job of
+ * Hadoop indexing task, those resource cleanups should be done in this
method.
*
* @param taskConfig TaskConfig for this task
+ *
+ * @see
org.apache.druid.indexing.worker.http.WorkerResource#doShutdown(String)
Review comment:
Could mention that this shutdown APi will cause stopGracefully to be called
either through lifecycle stop (ForkingTaskRunner on MM -> process shutdown ->
SingleTaskBackgroundRunner on Peon) or directly from an HTTP thread
(ThreadingTaskRunner for Indexer)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]