YARN-7973. Added ContainerRelaunch feature for Docker containers.

Addendum patch 001
            Contributed by Shane Kumpf
This commit is contained in:
Eric Yang 2018-05-03 12:46:04 -04:00
parent f729fb0baa
commit cf46533bca
1 changed files with 4 additions and 4 deletions

View File

@ -924,17 +924,17 @@ public class DockerLinuxContainerRuntime implements LinuxContainerRuntime {
@Override
public void relaunchContainer(ContainerRuntimeContext ctx)
throws ContainerExecutionException {
Container container = ctx.getContainer();
String containerIdStr = container.getContainerId().toString();
ContainerId containerId = ctx.getContainer().getContainerId();
String containerIdStr = containerId.toString();
// Check to see if the container already exists for relaunch
DockerCommandExecutor.DockerContainerStatus containerStatus =
DockerCommandExecutor.getContainerStatus(containerIdStr, conf,
privilegedOperationExecutor);
privilegedOperationExecutor, nmContext);
if (containerStatus != null &&
DockerCommandExecutor.isStartable(containerStatus)) {
DockerStartCommand startCommand = new DockerStartCommand(containerIdStr);
String commandFile = dockerClient.writeCommandToTempFile(startCommand,
containerIdStr);
containerId, nmContext);
PrivilegedOperation launchOp = buildLaunchOp(ctx, commandFile,
startCommand);