Skip to content

Commit

Permalink
[SPARK-12755][CORE] Stop the event logger before the DAG scheduler
Browse files Browse the repository at this point in the history
[SPARK-12755][CORE] Stop the event logger before the DAG scheduler to avoid a race condition where the standalone master attempts to build the app's history UI before the event log is stopped.

This contribution is my original work, and I license this work to the Spark project under the project's open source license.

Author: Michael Allman <michael@videoamp.com>

Closes #10700 from mallman/stop_event_logger_first.

(cherry picked from commit 4ee8191)
Signed-off-by: Sean Owen <sowen@cloudera.com>
  • Loading branch information
Michael Allman authored and srowen committed Jan 25, 2016
1 parent 88114d3 commit b40e58c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1726,12 +1726,6 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
Utils.tryLogNonFatalError {
_executorAllocationManager.foreach(_.stop())
}
if (_dagScheduler != null) {
Utils.tryLogNonFatalError {
_dagScheduler.stop()
}
_dagScheduler = null
}
if (_listenerBusStarted) {
Utils.tryLogNonFatalError {
listenerBus.stop()
Expand All @@ -1741,6 +1735,12 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
Utils.tryLogNonFatalError {
_eventLogger.foreach(_.stop())
}
if (_dagScheduler != null) {
Utils.tryLogNonFatalError {
_dagScheduler.stop()
}
_dagScheduler = null
}
if (env != null && _heartbeatReceiver != null) {
Utils.tryLogNonFatalError {
env.rpcEnv.stop(_heartbeatReceiver)
Expand Down

0 comments on commit b40e58c

Please sign in to comment.