Skip to content

Commit 446b0a4

Browse files
committed
Fix for SparkContext stop behavior
1 parent 2ce5760 commit 446b0a4

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

core/src/main/scala/org/apache/spark/SparkEnv.scala

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,18 @@ class SparkEnv (
9595

9696
if (!isStopped) {
9797
isStopped = true
98-
try {
99-
pythonWorkers.foreach { case (key, worker) => worker.stop()}
100-
Option(httpFileServer).foreach(_.stop())
101-
mapOutputTracker.stop()
102-
shuffleManager.stop()
103-
broadcastManager.stop()
104-
blockManager.stop()
105-
blockManager.master.stop()
106-
metricsSystem.stop()
107-
outputCommitCoordinator.stop()
108-
rpcEnv.shutdown()
109-
} catch {
110-
case NonFatal(e) =>
111-
logInfo("Exception while SparkEnv stop", e)
112-
throw e;
113-
}
98+
99+
pythonWorkers.foreach { case (key, worker) => worker.stop()}
100+
Option(httpFileServer).foreach(_.stop())
101+
mapOutputTracker.stop()
102+
shuffleManager.stop()
103+
broadcastManager.stop()
104+
blockManager.stop()
105+
blockManager.master.stop()
106+
metricsSystem.stop()
107+
outputCommitCoordinator.stop()
108+
rpcEnv.shutdown()
109+
114110

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

0 commit comments

Comments
 (0)