Skip to content

Commit 234d350

Browse files
committed
[SPARK-4626] Kill a task only if the executorId is (still) registered with the scheduler
1 parent a59c445 commit 234d350

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, actorSystem: A
118118
makeOffers()
119119

120120
case KillTask(taskId, executorId, interruptThread) =>
121-
executorActor(executorId) ! KillTask(taskId, executorId, interruptThread)
121+
if (executorActor.contains(executorId)) {
122+
executorActor(executorId) ! KillTask(taskId, executorId, interruptThread)
123+
} else {
124+
// Ignoring the task kill since the executor is not registered.
125+
logWarning(s"Attempted to kill task $taskId for unknown executor $executorId.")
126+
}
122127

123128
case StopDriver =>
124129
sender ! true

0 commit comments

Comments
 (0)