You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by zs...@apache.org on 2016/04/19 19:12:39 UTC

spark git commit: [SPARK-13904] Add exit code parameter to exitExecutor()

Repository: spark
Updated Branches:
  refs/heads/master 9ee95b6ec -> e89633605


[SPARK-13904] Add exit code parameter to exitExecutor()

## What changes were proposed in this pull request?

This PR adds exit code parameter to exitExecutor() so that caller can specify different exit code.

## How was this patch tested?

Existing test

rxin hbhanawat

Author: tedyu <yu...@gmail.com>

Closes #12457 from tedyu/master.


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

Branch: refs/heads/master
Commit: e89633605ea14547dcece35a7e12a9f0f78c5181
Parents: 9ee95b6
Author: tedyu <yu...@gmail.com>
Authored: Tue Apr 19 10:12:36 2016 -0700
Committer: Shixiong Zhu <sh...@databricks.com>
Committed: Tue Apr 19 10:12:36 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/spark/blob/e8963360/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 db5b774..e087295 100644
--- a/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
+++ b/core/src/main/scala/org/apache/spark/executor/CoarseGrainedExecutorBackend.scala
@@ -64,7 +64,7 @@ private[spark] class CoarseGrainedExecutorBackend(
         // Always receive `true`. Just ignore it
       case Failure(e) =>
         logError(s"Cannot register with driver: $driverUrl", e)
-        exitExecutor()
+        exitExecutor(1)
     }(ThreadUtils.sameThread)
   }
 
@@ -81,12 +81,12 @@ private[spark] class CoarseGrainedExecutorBackend(
 
     case RegisterExecutorFailed(message) =>
       logError("Slave registration failed: " + message)
-      exitExecutor()
+      exitExecutor(1)
 
     case LaunchTask(data) =>
       if (executor == null) {
         logError("Received LaunchTask command but executor was null")
-        exitExecutor()
+        exitExecutor(1)
       } else {
         val taskDesc = ser.deserialize[TaskDescription](data.value)
         logInfo("Got assigned task " + taskDesc.taskId)
@@ -97,7 +97,7 @@ private[spark] class CoarseGrainedExecutorBackend(
     case KillTask(taskId, _, interruptThread) =>
       if (executor == null) {
         logError("Received KillTask command but executor was null")
-        exitExecutor()
+        exitExecutor(1)
       } else {
         executor.killTask(taskId, interruptThread)
       }
@@ -127,7 +127,7 @@ private[spark] class CoarseGrainedExecutorBackend(
       logInfo(s"Driver from $remoteAddress disconnected during shutdown")
     } else if (driver.exists(_.address == remoteAddress)) {
       logError(s"Driver $remoteAddress disassociated! Shutting down.")
-      exitExecutor()
+      exitExecutor(1)
     } else {
       logWarning(s"An unknown ($remoteAddress) driver disconnected.")
     }
@@ -146,7 +146,7 @@ private[spark] class CoarseGrainedExecutorBackend(
    * executor exits differently. For e.g. when an executor goes down,
    * back-end may not want to take the parent process down.
    */
-  protected def exitExecutor(): Unit = System.exit(1)
+  protected def exitExecutor(code: Int): Unit = System.exit(code)
 }
 
 private[spark] object CoarseGrainedExecutorBackend extends Logging {


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