From 2d236c9de22e7f30891d9a3d55849c5cf9a1cc16 Mon Sep 17 00:00:00 2001 From: Jian He Date: Mon, 25 Jan 2016 15:35:51 -0800 Subject: [PATCH] YARN-4520. Finished app info is unnecessarily persisted in NM state-store if container is acquired but not lunched on this node. Contributed by sandflee --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../nodemanager/containermanager/ContainerManagerImpl.java | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index ca30567022b..c88b35fa483 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -1272,6 +1272,9 @@ Release 2.8.0 - UNRELEASED YARN-4592. Remove unused GetContainerStatus proto. (Chang Li via aajisaka) + YARN-4520. Finished app info is unnecessarily persisted in NM state-store + if container is acquired but not lunched on this node. (sandflee via jianeh) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java index f44de59719b..d0663d5f201 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java @@ -1310,6 +1310,12 @@ public class ContainerManagerImpl extends CompositeService implements CMgrCompletedAppsEvent appsFinishedEvent = (CMgrCompletedAppsEvent) event; for (ApplicationId appID : appsFinishedEvent.getAppsToCleanup()) { + Application app = this.context.getApplications().get(appID); + if (app == null) { + LOG.warn("couldn't find application " + appID + " while processing" + + " FINISH_APPS event"); + continue; + } String diagnostic = ""; if (appsFinishedEvent.getReason() == CMgrCompletedAppsEvent.Reason.ON_SHUTDOWN) { diagnostic = "Application killed on shutdown";