Skip to content

Commit

Permalink
[SPARK-6058][Yarn] Log the user class exception in ApplicationMaster
Browse files Browse the repository at this point in the history
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 <[email protected]>

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

806c932 [zsxwing] Log the user class exception
  • Loading branch information
zsxwing authored and srowen committed Feb 27, 2015
1 parent 8cd1692 commit e747e98
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,10 @@ private[spark] class ApplicationMaster(
case _: InterruptedException =>
// Reporter thread can interrupt to stop user class
case cause: Throwable =>
logError("User class threw exception: " + cause.getMessage, cause)
finish(FinalApplicationStatus.FAILED,
ApplicationMaster.EXIT_EXCEPTION_USER_CLASS,
"User class threw exception: " + cause.getMessage)
// re-throw to get it logged
throw cause
}
}
}
Expand Down

0 comments on commit e747e98

Please sign in to comment.