Github user mridulm commented on a diff in the pull request:
https://github.com/apache/spark/pull/16189#discussion_r92914965
--- Diff: core/src/main/scala/org/apache/spark/executor/Executor.scala ---
@@ -148,9 +161,23 @@ private[spark] class Executor(
}
def killTask(taskId: Long, interruptThread: Boolean): Unit = {
- val tr = runningTasks.get(taskId)
- if (tr != null) {
- tr.kill(interruptThread)
+ val taskRunner = runningTasks.get(taskId)
+ if (taskRunner != null) {
+ if (taskReaperEnabled) {
+ taskReaperForTask.synchronized {
+ val shouldCreateReaper = taskReaperForTask.get(taskId) match {
+ case None => true
+ case Some(existingReaper) => interruptThread &&
!existingReaper.interruptThread
+ }
+ if (shouldCreateReaper) {
+ val taskReaper = new TaskReaper(taskRunner, interruptThread =
interruptThread)
+ taskReaperForTask(taskId) = taskReaper
+ taskReaperPool.execute(taskReaper)
+ }
+ }
+ } else {
+ taskRunner.kill(interruptThread = interruptThread)
--- End diff --
Do we want to introduce dumping stack for this path ? I really like the
idea of doing that !
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]