Skip to content
Snippets Groups Projects
Commit e747e984 authored by zsxwing's avatar zsxwing Committed by Sean Owen
Browse files

[SPARK-6058][Yarn] Log the user class exception in ApplicationMaster

Because ApplicationMaster doesn't set SparkUncaughtExceptionHandler, the exception in the user class won't be logged. This PR added a `logError` for it.

Author: zsxwing <zsxwing@gmail.com>

Closes #4813 from zsxwing/SPARK-6058 and squashes the following commits:

806c932 [zsxwing] Log the user class exception
parent 8cd1692c
No related branches found
No related tags found
No related merge requests found
...@@ -486,11 +486,10 @@ private[spark] class ApplicationMaster( ...@@ -486,11 +486,10 @@ private[spark] class ApplicationMaster(
case _: InterruptedException => case _: InterruptedException =>
// Reporter thread can interrupt to stop user class // Reporter thread can interrupt to stop user class
case cause: Throwable => case cause: Throwable =>
logError("User class threw exception: " + cause.getMessage, cause)
finish(FinalApplicationStatus.FAILED, finish(FinalApplicationStatus.FAILED,
ApplicationMaster.EXIT_EXCEPTION_USER_CLASS, ApplicationMaster.EXIT_EXCEPTION_USER_CLASS,
"User class threw exception: " + cause.getMessage) "User class threw exception: " + cause.getMessage)
// re-throw to get it logged
throw cause
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment