Skip to content

Commit 4f95baf

Browse files
committed
[SPARK-4626] Kill a task only if the executorId is (still) registered with the scheduler
Author: roxchkplusony <roxchkplusony@gmail.com> Closes #3483 from roxchkplusony/bugfix/4626 and squashes the following commits: aba9184 [roxchkplusony] replace warning message per review 5e7fdea [roxchkplusony] [SPARK-4626] Kill a task only if the executorId is (still) registered with the scheduler
1 parent a59c445 commit 4f95baf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

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

120120
case KillTask(taskId, executorId, interruptThread) =>
121-
executorActor(executorId) ! KillTask(taskId, executorId, interruptThread)
121+
executorActor.get(executorId) match {
122+
case Some(executorInfo) =>
123+
executorInfo.executorActor ! KillTask(taskId, executorId, interruptThread)
124+
case None =>
125+
// Ignoring the task kill since the executor is not registered.
126+
logWarning(s"Attempted to kill task $taskId for unknown executor $executorId.")
127+
}
122128

123129
case StopDriver =>
124130
sender ! true

0 commit comments

Comments
 (0)