Ngone51 commented on a change in pull request #31127:
URL: https://github.com/apache/spark/pull/31127#discussion_r555475307
##########
File path: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
##########
@@ -1916,7 +1916,10 @@ private[spark] class DAGScheduler(
// killAllTaskAttempts will fail if a SchedulerBackend does not
implement killTask.
val reason = s"Task $task from barrier stage $failedStage
(${failedStage.name}) " +
"failed."
- taskScheduler.killAllTaskAttempts(stageId, interruptThread =
false, reason)
+ val job = jobIdToActiveJob.get(failedStage.firstJobId)
+ val shouldInterrupt =
+ job.map(j => shouldInterruptTaskThread(j)).getOrElse(false)
Review comment:
nit:
```suggestion
val shouldInterrupt = job.exists(j =>
shouldInterruptTaskThread(j))
```
##########
File path: core/src/test/scala/org/apache/spark/SparkContextSuite.scala
##########
@@ -1150,6 +1150,49 @@ class SparkContextSuite extends SparkFunSuite with
LocalSparkContext with Eventu
assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar")))
assert(sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar")))
}
+
+ test("SPARK-34069: Kill barrier tasks should respect
SPARK_JOB_INTERRUPT_ON_CANCEL") {
Review comment:
Shall we move it to `BarrierTaskContextSuite`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]