Skip to content

Commit 00df329

Browse files
committed
Wrap calls to the hooks with Utils.tryLogNonFatalError.
1 parent b694e27 commit 00df329

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,11 +1773,12 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
17731773
// Unset YARN mode system env variable, to allow switching between cluster types.
17741774
System.clearProperty("SPARK_YARN_MODE")
17751775
SparkContext.clearActiveContext()
1776-
_stopHooks.foreach(_())
1776+
_stopHooks.foreach(hook => Utils.tryLogNonFatalError {
1777+
hook()
1778+
})
17771779
logInfo("Successfully stopped SparkContext")
17781780
}
17791781

1780-
17811782
/**
17821783
* Get Spark's home location from either a value set through the constructor,
17831784
* or the spark.home Java property, or the SPARK_HOME environment variable

0 commit comments

Comments
 (0)