Skip to content

Commit

Permalink
[SNAP-846][CLUSTER] Ensuring that Uncaught exceptions are handled in …
Browse files Browse the repository at this point in the history
…the Snappy side and do not cause a system.exit (#2)

Instead of using SparkUncaughtExceptionHandler, executor now gets the uncaught exception handler and uses it to handle the exception. But if it is a local mode, it still uses the SparkUncaughtExceptionHandler

A test has been added in the Snappy side PR for the same.
  • Loading branch information
hbhanawat authored and ymahajan committed Jan 13, 2017
1 parent 055878d commit 12f4640
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/main/scala/org/apache/spark/executor/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,12 @@ private[spark] class Executor(
// Don't forcibly exit unless the exception was inherently fatal, to avoid
// stopping other tasks unnecessarily.
if (Utils.isFatalError(t)) {
SparkUncaughtExceptionHandler.uncaughtException(t)
if (!isLocal) {
Thread.getDefaultUncaughtExceptionHandler.
uncaughtException(Thread.currentThread(), t)
} else {
SparkUncaughtExceptionHandler.uncaughtException(t)
}
}

} finally {
Expand Down

0 comments on commit 12f4640

Please sign in to comment.