Skip to content

Commit

Permalink
Fix for SparkContext stop behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
rekhajoshm committed Jun 30, 2015
1 parent 2ce5760 commit 446b0a4
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions core/src/main/scala/org/apache/spark/SparkEnv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,18 @@ class SparkEnv (

if (!isStopped) {
isStopped = true
try {
pythonWorkers.foreach { case (key, worker) => worker.stop()}
Option(httpFileServer).foreach(_.stop())
mapOutputTracker.stop()
shuffleManager.stop()
broadcastManager.stop()
blockManager.stop()
blockManager.master.stop()
metricsSystem.stop()
outputCommitCoordinator.stop()
rpcEnv.shutdown()
} catch {
case NonFatal(e) =>
logInfo("Exception while SparkEnv stop", e)
throw e;
}

pythonWorkers.foreach { case (key, worker) => worker.stop()}
Option(httpFileServer).foreach(_.stop())
mapOutputTracker.stop()
shuffleManager.stop()
broadcastManager.stop()
blockManager.stop()
blockManager.master.stop()
metricsSystem.stop()
outputCommitCoordinator.stop()
rpcEnv.shutdown()


// Unfortunately Akka's awaitTermination doesn't actually wait for the Netty server to shut
// down, but let's call it anyway in case it gets fixed in a later release
Expand Down

0 comments on commit 446b0a4

Please sign in to comment.