From c4cf38dfc24e665cbb01cc1ee05f5d54df405345 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Fri, 28 Oct 2011 19:53:00 +0000 Subject: [PATCH] MAPREDUCE-3306. Fixed a bug in NodeManager ApplicationImpl that was causing NodeManager to crash. (vinodkv) svn merge -c r1190523 --ignore-ancestry ../../trunk/ git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1190526 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 3 +++ .../containermanager/application/ApplicationImpl.java | 11 ++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 7510b311d5e..642ee2d032d 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -1792,6 +1792,9 @@ Release 0.23.0 - Unreleased MAPREDUCE-3304. Fixed intermittent test failure due to a race in TestRMContainerAllocator#testBlackListedNodes. (Ravi Prakash via acmurthy) + MAPREDUCE-3306. Fixed a bug in NodeManager ApplicationImpl that was causing + NodeManager to crash. (vinodkv) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java index 7bde81f3808..d1914b5f616 100644 --- a/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java +++ b/hadoop-mapreduce-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/application/ApplicationImpl.java @@ -61,6 +61,7 @@ public class ApplicationImpl implements Application { final String user; final ApplicationId appId; final Credentials credentials; + Map applicationACLs; final ApplicationACLsManager aclsManager; private final ReadLock readLock; private final WriteLock writeLock; @@ -200,8 +201,8 @@ public class ApplicationImpl implements Application { @Override public void transition(ApplicationImpl app, ApplicationEvent event) { ApplicationInitEvent initEvent = (ApplicationInitEvent)event; - app.aclsManager.addApplication(app.getAppId(), initEvent - .getApplicationACLs()); + app.applicationACLs = initEvent.getApplicationACLs(); + app.aclsManager.addApplication(app.getAppId(), app.applicationACLs); app.dispatcher.getEventHandler().handle( new ApplicationLocalizationEvent( LocalizationEventType.INIT_APPLICATION_RESOURCES, app)); @@ -248,15 +249,11 @@ public class ApplicationImpl implements Application { @Override public void transition(ApplicationImpl app, ApplicationEvent event) { - Map appAcls = - app.getContainers().values().iterator().next().getLaunchContext() - .getApplicationACLs(); - // Inform the logAggregator app.dispatcher.getEventHandler().handle( new LogAggregatorAppStartedEvent(app.appId, app.user, app.credentials, ContainerLogsRetentionPolicy.ALL_CONTAINERS, - appAcls)); + app.applicationACLs)); // Start all the containers waiting for ApplicationInit for (Container container : app.containers.values()) {