aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSrinivasa Reddy Vundela <vsr@cloudera.com>2015-11-19 14:51:40 -0800
committerAndrew Or <andrew@databricks.com>2015-11-19 14:51:40 -0800
commit3bd77b213a9cd177c3ea3c61d37e5098e55f75a5 (patch)
tree0aa39913264cced2e75c88b93fb306a5e907ccb9 /core
parent90d384dcbc1d1a3466cf8bae570a26f23012c102 (diff)
downloadspark-3bd77b213a9cd177c3ea3c61d37e5098e55f75a5.tar.gz
spark-3bd77b213a9cd177c3ea3c61d37e5098e55f75a5.tar.bz2
spark-3bd77b213a9cd177c3ea3c61d37e5098e55f75a5.zip
[SPARK-11799][CORE] Make it explicit in executor logs that uncaught e…
…xceptions are thrown during executor shutdown This commit will make sure that when uncaught exceptions are prepended with [Container in shutdown] when JVM is shutting down. Author: Srinivasa Reddy Vundela <vsr@cloudera.com> Closes #9809 from vundela/master_11799.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/util/SparkUncaughtExceptionHandler.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/util/SparkUncaughtExceptionHandler.scala b/core/src/main/scala/org/apache/spark/util/SparkUncaughtExceptionHandler.scala
index 7248187247..5e322557e9 100644
--- a/core/src/main/scala/org/apache/spark/util/SparkUncaughtExceptionHandler.scala
+++ b/core/src/main/scala/org/apache/spark/util/SparkUncaughtExceptionHandler.scala
@@ -29,7 +29,11 @@ private[spark] object SparkUncaughtExceptionHandler
override def uncaughtException(thread: Thread, exception: Throwable) {
try {
- logError("Uncaught exception in thread " + thread, exception)
+ // Make it explicit that uncaught exceptions are thrown when container is shutting down.
+ // It will help users when they analyze the executor logs
+ val inShutdownMsg = if (ShutdownHookManager.inShutdown()) "[Container in shutdown] " else ""
+ val errMsg = "Uncaught exception in thread "
+ logError(inShutdownMsg + errMsg + thread, exception)
// We may have been called from a shutdown hook. If so, we must not call System.exit().
// (If we do, we will deadlock.)