Skip to content
Snippets Groups Projects
Commit dd11e401 authored by Charles Allen's avatar Charles Allen Committed by Sean Owen
Browse files

[SPARK-14537][CORE] Make TaskSchedulerImpl waiting fail if context is shut down

This patch makes the postStartHook throw an IllegalStateException if the SparkContext is shutdown while it is waiting for the backend to be ready

Author: Charles Allen <charles@allen-net.com>

Closes #12301 from drcrallen/SPARK-14537.
parent 23f93f55
No related branches found
No related tags found
No related merge requests found
......@@ -571,6 +571,11 @@ private[spark] class TaskSchedulerImpl(
return
}
while (!backend.isReady) {
// Might take a while for backend to be ready if it is waiting on resources.
if (sc.stopped.get) {
// For example: the master removes the application for some reason
throw new IllegalStateException("Spark context stopped while waiting for backend")
}
synchronized {
this.wait(100)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment