File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
core/src/main/scala/org/apache/spark/scheduler Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -677,8 +677,10 @@ class DAGScheduler(
677677 }
678678
679679 private [scheduler] def handleBeginEvent (task : Task [_], taskInfo : TaskInfo ) {
680- val stageInfo = stageIdToStage(task.stageId).latestInfo
681- listenerBus.post(SparkListenerTaskStart (task.stageId, stageInfo.attemptId, taskInfo))
680+ // Note that there is a chance that this task is launched after the stage is cancelled.
681+ // In that case, we wouldn't have the stage anymore in stageIdToStage.
682+ val stageAttemptId = stageIdToStage.get(task.stageId).map(_.latestInfo.attemptId).getOrElse(- 1 )
683+ listenerBus.post(SparkListenerTaskStart (task.stageId, stageAttemptId, taskInfo))
682684 submitWaitingStages()
683685 }
684686
You can’t perform that action at this time.
0 commit comments