Skip to content

Commit

Permalink
[SPARK-5268] don't stop CoarseGrainedExecutorBackend for irrelevant D…
Browse files Browse the repository at this point in the history
…isassociatedEvent

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 apache#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
  • Loading branch information
CodingCat authored and Andrew Or committed Jan 26, 2015
1 parent 0528b85 commit 8df9435
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8df9435

Please sign in to comment.