From 589276a496e7371de1e51b37b7afdf4af7c27286 Mon Sep 17 00:00:00 2001 From: CodingCat Date: Wed, 18 Mar 2015 14:40:08 -0400 Subject: [PATCH] throw fatal error again --- core/src/main/scala/org/apache/spark/util/Utils.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index bf732faf77705..d8440f32cb7a3 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -1171,11 +1171,15 @@ private[spark] object Utils extends Logging { } catch { case e: ControlThrowable => throw e case t: Throwable => + val currentThreadName = Thread.currentThread().getName if (sc != null) { - logError(s"uncaught error in thread ${Thread.currentThread().getName}, stopping " + - "SparkContext", t) + logError(s"uncaught error in thread $currentThreadName, stopping SparkContext", t) sc.stop() } + if (!NonFatal(t)) { + logError(s"throw uncaught fatal error in thread $currentThreadName", t) + throw t + } } }