sarutak commented on code in PR #59707:
URL: https://github.com/apache/spark/pull/59707#discussion_r4349505265
##########
core/src/main/scala/org/apache/spark/util/ThreadUtils.scala:
##########
@@ -423,13 +423,24 @@ private[spark] object ThreadUtils {
}
// scalastyle:on awaitready
+ /**
+ * Shuts down the executor, waiting up to `gracePeriod` for running and
queued tasks to finish.
+ * If they do not finish in time, or if the calling thread is interrupted
while waiting, calls
+ * `shutdownNow()` to interrupt the running tasks and drop the queued ones.
In the latter case,
+ * the `InterruptedException` is rethrown.
+ */
Review Comment:
nit: Could you mention in the Scaladoc that this method returns right after
`shutdownNow()` without waiting again, so the executor may still be running
(and tasks that ignore interrupts may keep running) when it returns?
Optionally, a `logWarning` with the number of tasks returned by `shutdownNow()`
would make it visible when queued work is dropped, since that is a new behavior
for some call sites.
--
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]