@@ -792,9 +792,14 @@ class DAGScheduler(
792
792
val stageId = task.stageId
793
793
val taskType = Utils .getFormattedClassName(task)
794
794
795
- if (! stageIdToStage.contains(task.stageId)) {
795
+ // The success case is dealt with separately below, since we need to compute accumulator
796
+ // updates before posting.
797
+ if (event.reason != Success ) {
796
798
listenerBus.post(SparkListenerTaskEnd (stageId, taskType, event.reason, event.taskInfo,
797
799
event.taskMetrics))
800
+ }
801
+
802
+ if (! stageIdToStage.contains(task.stageId)) {
798
803
// Skip all the actions if the stage has been cancelled.
799
804
return
800
805
}
@@ -829,6 +834,8 @@ class DAGScheduler(
829
834
AccumulableInfo (id, name, Some (stringPartialValue), stringValue)
830
835
}
831
836
}
837
+ listenerBus.post(SparkListenerTaskEnd (stageId, taskType, event.reason, event.taskInfo,
838
+ event.taskMetrics))
832
839
}
833
840
pendingTasks(stage) -= task
834
841
task match {
@@ -959,8 +966,6 @@ class DAGScheduler(
959
966
// Unrecognized failure - also do nothing. If the task fails repeatedly, the TaskScheduler
960
967
// will abort the job.
961
968
}
962
- listenerBus.post(SparkListenerTaskEnd (stageId, taskType, event.reason, event.taskInfo,
963
- event.taskMetrics))
964
969
submitWaitingStages()
965
970
}
966
971
0 commit comments