Browse Source

YARN-5049. Addendum patch for branch-2. (asuresh)

(cherry picked from commit c153bed6e3b38d60815c3f62d96c604f23116eb3)
Arun Suresh 7 years ago
parent
commit
1eb05c1dd4

+ 1 - 8
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/containermanager/ContainerManagerImpl.java

@@ -465,20 +465,13 @@ public class ContainerManagerImpl extends CompositeService implements
 
 
     Application app = context.getApplications().get(appId);
     Application app = context.getApplications().get(appId);
     if (app != null) {
     if (app != null) {
-      Credentials credentials =
-          YarnServerSecurityUtils.parseCredentials(launchContext);
-      Container container = new ContainerImpl(getConfig(), dispatcher,
-          req.getContainerLaunchContext(),
-          credentials, metrics, token, context, rcs);
-      context.getContainers().put(containerId, container);
-      app.handle(new ApplicationContainerInitEvent(container));
+      recoverActiveContainer(launchContext, token, rcs);
       if (rcs.getRecoveryType() == RecoveredContainerType.KILL) {
       if (rcs.getRecoveryType() == RecoveredContainerType.KILL) {
         dispatcher.getEventHandler().handle(
         dispatcher.getEventHandler().handle(
             new ContainerKillEvent(containerId, ContainerExitStatus.ABORTED,
             new ContainerKillEvent(containerId, ContainerExitStatus.ABORTED,
                 "Due to invalid StateStore info container was killed"
                 "Due to invalid StateStore info container was killed"
                     + " during recovery"));
                     + " during recovery"));
       }
       }
-      recoverActiveContainer(launchContext, token, rcs);
     } else {
     } else {
       if (rcs.getStatus() != RecoveredContainerStatus.COMPLETED) {
       if (rcs.getStatus() != RecoveredContainerStatus.COMPLETED) {
         LOG.warn(containerId + " has no corresponding application!");
         LOG.warn(containerId + " has no corresponding application!");