From 4f63ffe444286dac91ed36fd647d8ce69e75b0f0 Mon Sep 17 00:00:00 2001 From: Weiwei Yang Date: Tue, 29 Jan 2019 10:34:26 +0800 Subject: [PATCH] YARN-9237. NM should ignore sending finished apps to RM during RM fail-over. Contributed by Jiandan Yang. --- .../yarn/server/nodemanager/NodeStatusUpdaterImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java index 3fbe0c4506..5762ffa9ea 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeStatusUpdaterImpl.java @@ -630,7 +630,13 @@ protected List getContainerStatuses() throws IOException { private List getRunningApplications() { List runningApplications = new ArrayList(); - runningApplications.addAll(this.context.getApplications().keySet()); + for (Entry appEntry : this.context + .getApplications().entrySet()) { + if (ApplicationState.FINISHED != appEntry.getValue() + .getApplicationState()) { + runningApplications.add(appEntry.getKey()); + } + } return runningApplications; }