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 5975784de5c..b5706253316 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 @@ -628,7 +628,13 @@ public class NodeStatusUpdaterImpl extends AbstractService implements 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; }