Skip to content
Closed
Show file tree
Hide file tree
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 @@ -394,7 +394,7 @@ private[spark] class TaskSchedulerImpl(

def error(message: String) {
synchronized {
if (activeTaskSets.size > 0) {
if (activeTaskSets.nonEmpty) {
// Have each task set throw a SparkException with the error
for ((taskSetId, manager) <- activeTaskSets) {
try {
Expand All @@ -407,8 +407,7 @@ private[spark] class TaskSchedulerImpl(
// No task sets are active but we still got an error. Just exit since this
// must mean the error is during registration.
// It might be good to do something smarter here in the future.
logError("Exiting due to error from cluster scheduler: " + message)
System.exit(1)
throw new SparkException(s"Exiting due to error from cluster scheduler: $message")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ private[spark] class SparkDeploySchedulerBackend(
notifyContext()
if (!stopping) {
logError("Application has been killed. Reason: " + reason)
scheduler.error(reason)
// Ensure the application terminates, as we can no longer run jobs.
sc.stop()
try {
scheduler.error(reason)
} finally {
// Ensure the application terminates, as we can no longer run jobs.
sc.stop()
}
}
}

Expand Down