Skip to content

Commit f0bc54f

Browse files
minor: expose appid in excepiton messages
1 parent ba9b22b commit f0bc54f

File tree

1 file changed

+4
-4
lines changed
  • yarn/src/main/scala/org/apache/spark/deploy/yarn

1 file changed

+4
-4
lines changed

yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -626,22 +626,22 @@ private[spark] class Client(
626626
val report = getApplicationReport(appId)
627627
val state = report.getYarnApplicationState
628628
if (state == YarnApplicationState.FAILED || state == YarnApplicationState.KILLED) {
629-
throw new SparkException(s"Application finished with status: $state")
629+
throw new SparkException(s"Application $appId finished with status: $state")
630630
}
631631
logInfo(s"Application report for $appId (state: $state)")
632632
logInfo(formatReportDetails(report))
633633
} else {
634634
val (yarnApplicationState, finalApplicationStatus) = monitorApplication(appId)
635635
if (yarnApplicationState == YarnApplicationState.FAILED ||
636636
finalApplicationStatus == FinalApplicationStatus.FAILED) {
637-
throw new SparkException("Application finished with failed status")
637+
throw new SparkException(s"Application $appId finished with failed status")
638638
}
639639
if (yarnApplicationState == YarnApplicationState.KILLED ||
640640
finalApplicationStatus == FinalApplicationStatus.KILLED) {
641-
throw new SparkException("Application is killed")
641+
throw new SparkException(s"Application $appId is killed")
642642
}
643643
if (finalApplicationStatus == FinalApplicationStatus.UNDEFINED) {
644-
throw new SparkException("The final status of application is undefined")
644+
throw new SparkException(s"The final status of application $appId is undefined")
645645
}
646646
}
647647
}

0 commit comments

Comments
 (0)