YARN-7818. Remove privileged operation warnings during container launch for the ContainerRuntimes. Contributed by Shane Kumpf
This commit is contained in:
parent
a3b416f69d
commit
502914ca32
|
@ -108,6 +108,9 @@ public class DefaultLinuxContainerRuntime implements LinuxContainerRuntime {
|
||||||
launchOp.appendArgs(tcCommandFile);
|
launchOp.appendArgs(tcCommandFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some failures here are acceptable. Let the calling executor decide.
|
||||||
|
launchOp.disableFailureLogging();
|
||||||
|
|
||||||
//List<String> -> stored as List -> fetched/converted to List<String>
|
//List<String> -> stored as List -> fetched/converted to List<String>
|
||||||
//we can't do better here thanks to type-erasure
|
//we can't do better here thanks to type-erasure
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
@ -118,8 +121,6 @@ public class DefaultLinuxContainerRuntime implements LinuxContainerRuntime {
|
||||||
privilegedOperationExecutor.executePrivilegedOperation(prefixCommands,
|
privilegedOperationExecutor.executePrivilegedOperation(prefixCommands,
|
||||||
launchOp, null, null, false, false);
|
launchOp, null, null, false, false);
|
||||||
} catch (PrivilegedOperationException e) {
|
} catch (PrivilegedOperationException e) {
|
||||||
LOG.warn("Launch container failed. Exception: ", e);
|
|
||||||
|
|
||||||
throw new ContainerExecutionException("Launch container failed", e
|
throw new ContainerExecutionException("Launch container failed", e
|
||||||
.getExitCode(), e.getOutput(), e.getErrorOutput());
|
.getExitCode(), e.getOutput(), e.getErrorOutput());
|
||||||
}
|
}
|
||||||
|
|
|
@ -914,13 +914,13 @@ public class DockerLinuxContainerRuntime implements LinuxContainerRuntime {
|
||||||
PrivilegedOperation launchOp = buildLaunchOp(ctx,
|
PrivilegedOperation launchOp = buildLaunchOp(ctx,
|
||||||
commandFile, runCommand);
|
commandFile, runCommand);
|
||||||
|
|
||||||
|
// Some failures here are acceptable. Let the calling executor decide.
|
||||||
|
launchOp.disableFailureLogging();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
privilegedOperationExecutor.executePrivilegedOperation(null,
|
privilegedOperationExecutor.executePrivilegedOperation(null,
|
||||||
launchOp, null, null, false, false);
|
launchOp, null, null, false, false);
|
||||||
} catch (PrivilegedOperationException e) {
|
} catch (PrivilegedOperationException e) {
|
||||||
LOG.warn("Launch container failed. Exception: ", e);
|
|
||||||
LOG.info("Docker command used: " + runCommand);
|
|
||||||
|
|
||||||
throw new ContainerExecutionException("Launch container failed", e
|
throw new ContainerExecutionException("Launch container failed", e
|
||||||
.getExitCode(), e.getOutput(), e.getErrorOutput());
|
.getExitCode(), e.getOutput(), e.getErrorOutput());
|
||||||
}
|
}
|
||||||
|
@ -943,14 +943,14 @@ public class DockerLinuxContainerRuntime implements LinuxContainerRuntime {
|
||||||
PrivilegedOperation launchOp = buildLaunchOp(ctx, commandFile,
|
PrivilegedOperation launchOp = buildLaunchOp(ctx, commandFile,
|
||||||
startCommand);
|
startCommand);
|
||||||
|
|
||||||
|
// Some failures here are acceptable. Let the calling executor decide.
|
||||||
|
launchOp.disableFailureLogging();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
privilegedOperationExecutor.executePrivilegedOperation(null,
|
privilegedOperationExecutor.executePrivilegedOperation(null,
|
||||||
launchOp, null, null, false, false);
|
launchOp, null, null, false, false);
|
||||||
} catch (PrivilegedOperationException e) {
|
} catch (PrivilegedOperationException e) {
|
||||||
LOG.warn("Relaunch container failed. Exception: ", e);
|
throw new ContainerExecutionException("Relaunch container failed", e
|
||||||
LOG.info("Docker command used: " + startCommand);
|
|
||||||
|
|
||||||
throw new ContainerExecutionException("Launch container failed", e
|
|
||||||
.getExitCode(), e.getOutput(), e.getErrorOutput());
|
.getExitCode(), e.getOutput(), e.getErrorOutput());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue