Skip to content

Commit

Permalink
kill the process when the error happens
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingCat committed Apr 16, 2014
1 parent 0accf2f commit eb615ba
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ private[spark] class ExecutorRunner(
// long-lived processes only. However, in the future, we might restart the executor a few
// times on the same machine.
val exitCode = process.waitFor()
killProcess()
state = ExecutorState.FAILED
val message = "Command exited with code " + exitCode
worker ! ExecutorStateChanged(appId, execId, state, Some(message), Some(exitCode))
Expand All @@ -150,9 +151,7 @@ private[spark] class ExecutorRunner(
}
case e: Exception => {
logError("Error running executor", e)
if (process != null) {
process.destroy()
}
killProcess()
state = ExecutorState.FAILED
val message = e.getClass + ": " + e.getMessage
worker ! ExecutorStateChanged(appId, execId, state, Some(message), None)
Expand Down

0 comments on commit eb615ba

Please sign in to comment.