diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala index 33b231d7c2cb1..b42820a8eefdc 100644 --- a/core/src/main/scala/org/apache/spark/SparkContext.scala +++ b/core/src/main/scala/org/apache/spark/SparkContext.scala @@ -1769,7 +1769,13 @@ class SparkContext(config: SparkConf) extends Logging { setDaemon(true) override def run(): Unit = { - SparkContext.this.stop() + try { + SparkContext.this.stop() + } catch { + case e: Throwable => + logError(e.getMessage, e) + throw e + } } }.start() }