Github user jinxing64 commented on a diff in the pull request:
https://github.com/apache/spark/pull/16620#discussion_r98488916
--- Diff:
core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala ---
@@ -718,6 +703,21 @@ private[spark] class TaskSetManager(
" because task " + index + " has already completed successfully")
}
maybeFinishTaskSet()
+ // This method is called by "TaskSchedulerImpl.handleSuccessfulTask"
which holds the
+ // "TaskSchedulerImpl" lock until exiting. To avoid the SPARK-7655
issue, we should not
+ // "deserialize" the value when holding a lock to avoid blocking other
threads. So we call
+ // "result.value()" in "TaskResultGetter.enqueueSuccessfulTask" before
reaching here.
+ // Note: "result.value()" only deserializes the value when it's called
at the first time, so
+ // here "result.value()" just returns the value and won't block other
threads.
+ sched.dagScheduler.taskEnded(tasks(index), Success, result.value(),
result.accumUpdates, info)
+ // Kill any other attempts for the same task (since those are
unnecessary now that one
+ // attempt completed successfully).
+ for (attemptInfo <- taskAttempts(index) if attemptInfo.running) {
+ logInfo(s"Killing attempt ${attemptInfo.attemptNumber} for task
${attemptInfo.id} " +
+ s"in stage ${taskSet.id} (TID ${attemptInfo.taskId}) on
${attemptInfo.host} " +
+ s"as the attempt ${info.attemptNumber} succeeded on ${info.host}")
+ sched.backend.killTask(attemptInfo.taskId, attemptInfo.executorId,
true)
+ }
--- End diff --
@squito
Yes, it make sense to move this part before `maybeFinishTaskSet()`, I will
refine.
---
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]