Skip to content

Commit 1f640aa

Browse files
slfan1989zhtttylz
andauthored
YARN-11787. [Federation] Enhance Exception Handling in FederationClientInterceptor#forceKillApplication. (#7465) Contributed by Shilun Fan.
Co-authored-by: Hualong Zhang <[email protected]> Signed-off-by: Shilun Fan <[email protected]>
1 parent 758f3a0 commit 1f640aa

File tree

1 file changed

+9
-3
lines changed
  • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm

1 file changed

+9
-3
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -667,9 +667,15 @@ public KillApplicationResponse forceKillApplication(
667667
// If kill home sub-cluster application is successful,
668668
// we will try to kill the same application in other sub-clusters.
669669
if (response != null) {
670-
ClientMethod remoteMethod = new ClientMethod("forceKillApplication",
671-
new Class[]{KillApplicationRequest.class}, new Object[]{request});
672-
invokeConcurrent(remoteMethod, KillApplicationResponse.class, subClusterId);
670+
try {
671+
ClientMethod remoteMethod = new ClientMethod("forceKillApplication",
672+
new Class[]{KillApplicationRequest.class}, new Object[]{request});
673+
invokeConcurrent(remoteMethod, KillApplicationResponse.class, subClusterId);
674+
} catch (YarnException e) {
675+
// We cannot confirm whether the application exists in other sub-clusters,
676+
// so this method may throw an error, which we should ignore.
677+
LOG.warn("The execution of forceKillApplication failed in the sub-cluster.", e);
678+
}
673679
}
674680
} catch (Exception e) {
675681
routerMetrics.incrAppsFailedKilled();

0 commit comments

Comments
 (0)