YARN-4831. Recovered containers will be killed after NM stateful restart. Contributed by Siqi Li

This commit is contained in:
Jason Lowe 2016-10-27 20:41:43 +00:00
parent 31ff42b510
commit 7e3c327d31

View File

@ -1506,6 +1506,9 @@ public void transition(ContainerImpl container, ContainerEvent event) {
static class KillOnNewTransition extends ContainerDoneTransition { static class KillOnNewTransition extends ContainerDoneTransition {
@Override @Override
public void transition(ContainerImpl container, ContainerEvent event) { public void transition(ContainerImpl container, ContainerEvent event) {
if (container.recoveredStatus == RecoveredContainerStatus.COMPLETED) {
container.sendFinishedEvents();
} else {
ContainerKillEvent killEvent = (ContainerKillEvent) event; ContainerKillEvent killEvent = (ContainerKillEvent) event;
container.exitCode = killEvent.getContainerExitStatus(); container.exitCode = killEvent.getContainerExitStatus();
container.addDiagnostics(killEvent.getDiagnostic(), "\n"); container.addDiagnostics(killEvent.getDiagnostic(), "\n");
@ -1518,6 +1521,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
super.transition(container, event); super.transition(container, event);
} }
} }
}
/** /**
* Handle the following transition: * Handle the following transition: