YARN-4643. Container recovery is broken with delegating container runtime. Contributed by Sidharta Seethana

This commit is contained in:
Jason Lowe 2016-01-28 18:59:35 +00:00
parent ef343be82b
commit 61382ff8fa
3 changed files with 16 additions and 3 deletions

View File

@ -1345,6 +1345,9 @@ Release 2.8.0 - UNRELEASED
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)
YARN-4643. Container recovery is broken with delegating container runtime
(Sidharta Seethana via jlowe)
Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -83,9 +83,10 @@ public class RecoveredContainerLaunch extends ContainerLaunch {
exec.activateContainer(containerId, pidFilePath);
retCode = exec.reacquireContainer(
new ContainerReacquisitionContext.Builder()
.setUser(container.getUser())
.setContainerId(containerId)
.build());
.setContainer(container)
.setUser(container.getUser())
.setContainerId(containerId)
.build());
} else {
LOG.warn("Unable to locate pid file for container " + containerIdStr);
}

View File

@ -629,7 +629,16 @@ public class TestLinuxContainerExecutor {
} catch (IOException e) {
// expected if LCE isn't setup right, but not necessary for this test
}
Container container = mock(Container.class);
ContainerLaunchContext context = mock(ContainerLaunchContext.class);
HashMap<String, String> env = new HashMap<>();
when(container.getLaunchContext()).thenReturn(context);
when(context.getEnvironment()).thenReturn(env);
lce.reacquireContainer(new ContainerReacquisitionContext.Builder()
.setContainer(container)
.setUser("foouser")
.setContainerId(cid)
.build());