Repository: spark
Updated Branches:
  refs/heads/branch-1.6 ced71d353 -> e2a43d007


[SPARK-15262] Synchronize block manager / scheduler executor state

## What changes were proposed in this pull request?

If an executor is still alive even after the scheduler has removed its 
metadata, we may receive a heartbeat from that executor and tell its block 
manager to reregister itself. If that happens, the block manager master will 
know about the executor, but the scheduler will not.

That is a dangerous situation, because when the executor does get disconnected 
later, the scheduler will not ask the block manager to also remove metadata for 
that executor. Later, when we try to clean up an RDD or a broadcast variable, 
we may try to send a message to that executor, triggering an exception.

## How was this patch tested?

Jenkins.

Author: Andrew Or <and...@databricks.com>

Closes #13055 from andrewor14/block-manager-remove.

(cherry picked from commit 40a949aae9c3040019a52482d091912a85b0f4d4)
Signed-off-by: Shixiong Zhu <shixi...@databricks.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e2a43d00
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e2a43d00
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e2a43d00

Branch: refs/heads/branch-1.6
Commit: e2a43d0070b7204b1c6ed1c9292f1d215e0df30d
Parents: ced71d3
Author: Andrew Or <and...@databricks.com>
Authored: Wed May 11 13:36:58 2016 -0700
Committer: Shixiong Zhu <shixi...@databricks.com>
Committed: Wed May 11 13:37:16 2016 -0700

----------------------------------------------------------------------
 .../scheduler/cluster/CoarseGrainedSchedulerBackend.scala   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e2a43d00/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
----------------------------------------------------------------------
diff --git 
a/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
 
b/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
index 7189685..87f2dbf 100644
--- 
a/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
+++ 
b/core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
@@ -267,7 +267,14 @@ class CoarseGrainedSchedulerBackend(scheduler: 
TaskSchedulerImpl, val rpcEnv: Rp
           scheduler.executorLost(executorId, if (killed) ExecutorKilled else 
reason)
           listenerBus.post(
             SparkListenerExecutorRemoved(System.currentTimeMillis(), 
executorId, reason.toString))
-        case None => logInfo(s"Asked to remove non-existent executor 
$executorId")
+        case None =>
+          // SPARK-15262: If an executor is still alive even after the 
scheduler has removed
+          // its metadata, we may receive a heartbeat from that executor and 
tell its block
+          // manager to reregister itself. If that happens, the block manager 
master will know
+          // about the executor, but the scheduler will not. Therefore, we 
should remove the
+          // executor from the block manager when we hit this case.
+          scheduler.sc.env.blockManager.master.removeExecutor(executorId)
+          logInfo(s"Asked to remove non-existent executor $executorId")
       }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to