diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java index 4f9cbd603b509..6884381e99a5c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/clientrm/FederationClientInterceptor.java @@ -667,9 +667,15 @@ public KillApplicationResponse forceKillApplication( // If kill home sub-cluster application is successful, // we will try to kill the same application in other sub-clusters. if (response != null) { - ClientMethod remoteMethod = new ClientMethod("forceKillApplication", - new Class[]{KillApplicationRequest.class}, new Object[]{request}); - invokeConcurrent(remoteMethod, KillApplicationResponse.class, subClusterId); + try { + ClientMethod remoteMethod = new ClientMethod("forceKillApplication", + new Class[]{KillApplicationRequest.class}, new Object[]{request}); + invokeConcurrent(remoteMethod, KillApplicationResponse.class, subClusterId); + } catch (YarnException e) { + // We cannot confirm whether the application exists in other sub-clusters, + // so this method may throw an error, which we should ignore. + LOG.warn("The execution of forceKillApplication failed in the sub-cluster.", e); + } } } catch (Exception e) { routerMetrics.incrAppsFailedKilled();