We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37cff1b commit 19c144eCopy full SHA for 19c144e
core/src/main/scala/org/apache/spark/SparkContext.scala
@@ -1694,6 +1694,10 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
1694
1695
// Shut down the SparkContext.
1696
def stop() {
1697
+ if (AsynchronousListenerBus.withinListenerThread.value) {
1698
+ throw new SparkException("Cannot stop SparkContext within listener thread of" +
1699
+ " AsynchronousListenerBus")
1700
+ }
1701
// Use the stopping variable to ensure no contention for the stop scenario.
1702
// Still track the stopped variable for use elsewhere in the code.
1703
if (!stopped.compareAndSet(false, true)) {
0 commit comments