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

This commit is contained in:
Arun Suresh 2017-11-12 10:16:00 -08:00
parent 90ac8cd5a1
commit c153bed6e3

View File

@ -465,20 +465,13 @@ private void recoverContainer(RecoveredContainerState rcs)
Application app = context.getApplications().get(appId); Application app = context.getApplications().get(appId);
if (app != null) { if (app != null) {
Credentials credentials = recoverActiveContainer(launchContext, token, rcs);
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));
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!");