Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
Expand All @@ -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)
}
Expand Down Expand Up @@ -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.")
}
Expand All @@ -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 {
Expand Down