aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorZhen Peng <zhenpeng01@baidu.com>2014-05-24 20:40:19 -0700
committerAaron Davidson <aaron@databricks.com>2014-05-24 20:40:19 -0700
commit4e4831b8facc186cda6ef31040ccdeab48acbbb7 (patch)
tree72c2a17ccadc2af6fb3d11508799584b5fa82fc5 /core
parent75a03277704f8618a0f1c41aecfb1ebd24a8ac1a (diff)
downloadspark-4e4831b8facc186cda6ef31040ccdeab48acbbb7.tar.gz
spark-4e4831b8facc186cda6ef31040ccdeab48acbbb7.tar.bz2
spark-4e4831b8facc186cda6ef31040ccdeab48acbbb7.zip
[SPARK-1886] check executor id existence when executor exit
Author: Zhen Peng <zhenpeng01@baidu.com> Closes #827 from zhpengg/bugfix-executor-id-not-found and squashes the following commits: cd8bb65 [Zhen Peng] bugfix: check executor id existence when executor exit
Diffstat (limited to 'core')
-rwxr-xr-xcore/src/main/scala/org/apache/spark/deploy/worker/Worker.scala22
1 files changed, 14 insertions, 8 deletions
diff --git a/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala b/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
index fb9cc116cd..8b6747977e 100755
--- a/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala
@@ -263,14 +263,20 @@ private[spark] class Worker(
}
val fullId = appId + "/" + execId
if (ExecutorState.isFinished(state)) {
- val executor = executors(fullId)
- logInfo("Executor " + fullId + " finished with state " + state +
- message.map(" message " + _).getOrElse("") +
- exitStatus.map(" exitStatus " + _).getOrElse(""))
- executors -= fullId
- finishedExecutors(fullId) = executor
- coresUsed -= executor.cores
- memoryUsed -= executor.memory
+ executors.get(fullId) match {
+ case Some(executor) =>
+ logInfo("Executor " + fullId + " finished with state " + state +
+ message.map(" message " + _).getOrElse("") +
+ exitStatus.map(" exitStatus " + _).getOrElse(""))
+ executors -= fullId
+ finishedExecutors(fullId) = executor
+ coresUsed -= executor.cores
+ memoryUsed -= executor.memory
+ case None =>
+ logInfo("Unknown Executor " + fullId + " finished with state " + state +
+ message.map(" message " + _).getOrElse("") +
+ exitStatus.map(" exitStatus " + _).getOrElse(""))
+ }
}
case KillExecutor(masterUrl, appId, execId) =>