Github user jiangxb1987 commented on a diff in the pull request: https://github.com/apache/spark/pull/22771#discussion_r227459990 --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala --- @@ -1364,6 +1385,16 @@ private[spark] class DAGScheduler( if (job.numFinished == job.numPartitions) { markStageAsFinished(resultStage) cleanupStateForJobAndIndependentStages(job) + try { // cancelTasks will fail if a SchedulerBackend does not implement killTask + logInfo( + s"Job ${job.jobId} is finished. Killing speculative tasks for this job") + // ResultStage is only used by this job. It's safe to kill speculative or + // zombie tasks in this stage. + taskScheduler.cancelTasks(stageId, shouldInterruptTaskThread(job)) --- End diff -- IIRC `cancelTasks()` will fail the stage (maybe it's okay here coz the stage has been marked completed), if we just want to kill speculative/zombie tasks then maybe we shall call `killAllTaskAttempts()` ?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org