Skip to content

Commit

Permalink
[SPARK-4117][YARN] Spark on Yarn handle AM being told command from RM
Browse files Browse the repository at this point in the history
Spark on Yarn handle AM being told command from RM

When RM throws ApplicationAttemptNotFoundException for allocate
invocation, making the ApplicationMaster to finish immediately without any
retries.

Author: Devaraj K <[email protected]>

Closes apache#10129 from devaraj-kavali/SPARK-4117.
  • Loading branch information
Devaraj K authored and Andrew Or committed Dec 16, 2015
1 parent a89e8b6 commit ca0690b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,14 @@ private[spark] class ApplicationMaster(
case i: InterruptedException =>
case e: Throwable => {
failureCount += 1
if (!NonFatal(e) || failureCount >= reporterMaxFailures) {
// this exception was introduced in hadoop 2.4 and this code would not compile
// with earlier versions if we refer it directly.
if ("org.apache.hadoop.yarn.exceptions.ApplicationAttemptNotFoundException" ==
e.getClass().getName()) {
logError("Exception from Reporter thread.", e)
finish(FinalApplicationStatus.FAILED, ApplicationMaster.EXIT_REPORTER_FAILURE,
e.getMessage)
} else if (!NonFatal(e) || failureCount >= reporterMaxFailures) {
finish(FinalApplicationStatus.FAILED,
ApplicationMaster.EXIT_REPORTER_FAILURE, "Exception was thrown " +
s"$failureCount time(s) from Reporter thread.")
Expand Down

0 comments on commit ca0690b

Please sign in to comment.