From 27de4fb65b7400d7d2e76843cb9eb1c55c9d69d4 Mon Sep 17 00:00:00 2001 From: Devaraj K Date: Thu, 12 May 2016 11:55:38 +0530 Subject: [PATCH 1/2] [SPARK-15288] [Mesos] Mesos dispatcher should handle gracefully when any thread gets UncaughtException --- .../org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala b/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala index a057977eb0dd2..ec2217f785cf9 100644 --- a/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala +++ b/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala @@ -24,7 +24,7 @@ import org.apache.spark.deploy.mesos.ui.MesosClusterUI import org.apache.spark.deploy.rest.mesos.MesosRestServer import org.apache.spark.internal.Logging import org.apache.spark.scheduler.cluster.mesos._ -import org.apache.spark.util.{ShutdownHookManager, Utils} +import org.apache.spark.util.{SparkUncaughtExceptionHandler, ShutdownHookManager, Utils} /* * A dispatcher that is responsible for managing and launching drivers, and is intended to be @@ -93,6 +93,7 @@ private[mesos] class MesosClusterDispatcher( private[mesos] object MesosClusterDispatcher extends Logging { def main(args: Array[String]) { + Thread.setDefaultUncaughtExceptionHandler(SparkUncaughtExceptionHandler) Utils.initDaemon(log) val conf = new SparkConf val dispatcherArgs = new MesosClusterDispatcherArguments(args, conf) From 2f306a785f3adbbba7420d27630b6f1553139074 Mon Sep 17 00:00:00 2001 From: Devaraj K Date: Tue, 17 May 2016 14:38:41 +0530 Subject: [PATCH 2/2] Fixed scala style warning --- .../org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala b/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala index ec2217f785cf9..c155abf52a91a 100644 --- a/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala +++ b/core/src/main/scala/org/apache/spark/deploy/mesos/MesosClusterDispatcher.scala @@ -24,7 +24,7 @@ import org.apache.spark.deploy.mesos.ui.MesosClusterUI import org.apache.spark.deploy.rest.mesos.MesosRestServer import org.apache.spark.internal.Logging import org.apache.spark.scheduler.cluster.mesos._ -import org.apache.spark.util.{SparkUncaughtExceptionHandler, ShutdownHookManager, Utils} +import org.apache.spark.util.{ShutdownHookManager, SparkUncaughtExceptionHandler, Utils} /* * A dispatcher that is responsible for managing and launching drivers, and is intended to be