File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
yarn/common/src/main/scala/org/apache/spark/scheduler/cluster Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ package org.apache.spark.scheduler.cluster
2020import scala .collection .mutable .ArrayBuffer
2121
2222import org .apache .hadoop .yarn .api .records .{ApplicationId , YarnApplicationState }
23+ import org .apache .hadoop .yarn .exceptions .ApplicationNotFoundException
2324
2425import org .apache .spark .{SparkException , Logging , SparkContext }
2526import org .apache .spark .deploy .yarn .{Client , ClientArguments }
@@ -132,8 +133,14 @@ private[spark] class YarnClientSchedulerBackend(
132133 val t = new Thread {
133134 override def run () {
134135 while (! stopping) {
135- val report = client.getApplicationReport(appId)
136- val state = report.getYarnApplicationState()
136+ var state : YarnApplicationState = null
137+ try {
138+ val report = client.getApplicationReport(appId)
139+ state = report.getYarnApplicationState()
140+ } catch {
141+ case e : ApplicationNotFoundException =>
142+ state = YarnApplicationState .KILLED
143+ }
137144 if (state == YarnApplicationState .FINISHED ||
138145 state == YarnApplicationState .KILLED ||
139146 state == YarnApplicationState .FAILED ) {
You can’t perform that action at this time.
0 commit comments