Repository: spark
Updated Branches:
  refs/heads/master 0528b85cf -> 8df943551


[SPARK-5268] don't stop CoarseGrainedExecutorBackend for irrelevant 
DisassociatedEvent

https://issues.apache.org/jira/browse/SPARK-5268

In CoarseGrainedExecutorBackend, we subscribe DisassociatedEvent in executor 
backend actor and exit the program upon receive such event...

let's consider the following case

The user may develop an Akka-based program which starts the actor with Spark's 
actor system and communicate with an external actor system (e.g. an Akka-based 
receiver in spark streaming which communicates with an external system) If the 
external actor system fails or disassociates with the actor within spark's 
system with purpose, we may receive DisassociatedEvent and the executor is 
restarted.

This is not the expected behavior.....

----

This is a simple fix to check the event before making the quit decision

Author: CodingCat <[email protected]>

Closes #4063 from CodingCat/SPARK-5268 and squashes the following commits:

4d7d48e [CodingCat] simplify the log
18c36f4 [CodingCat] more descriptive log
f299e0b [CodingCat] clean log
1632e79 [CodingCat] check whether DisassociatedEvent is relevant before quit


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

Branch: refs/heads/master
Commit: 8df9435512e4b4df12b55143a910d9ce3d4bd62c
Parents: 0528b85
Author: CodingCat <[email protected]>
Authored: Sun Jan 25 19:28:53 2015 -0800
Committer: Andrew Or <[email protected]>
Committed: Sun Jan 25 19:28:53 2015 -0800

----------------------------------------------------------------------
 .../apache/spark/executor/CoarseGrainedExecutorBackend.scala | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/8df94355/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
----------------------------------------------------------------------
diff --git 
a/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
 
b/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
index 9a4adfb..8238253 100644
--- 
a/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
+++ 
b/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
@@ -84,8 +84,12 @@ private[spark] class CoarseGrainedExecutorBackend(
       }
 
     case x: DisassociatedEvent =>
-      logError(s"Driver $x disassociated! Shutting down.")
-      System.exit(1)
+      if (x.remoteAddress == driver.anchorPath.address) {
+        logError(s"Driver $x disassociated! Shutting down.")
+        System.exit(1)
+      } else {
+        logWarning(s"Received irrelevant DisassociatedEvent $x")
+      }
 
     case StopExecutor =>
       logInfo("Driver commanded a shutdown")


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to