YARN-4831. Recovered containers will be killed after NM stateful restart. Contributed by Siqi Li
(cherry picked from commit 7e3c327d31
)
This commit is contained in:
parent
40dbf2a18d
commit
d21dc8aa6c
|
@ -1010,16 +1010,20 @@ public class ContainerImpl implements Container {
|
|||
static class KillOnNewTransition extends ContainerDoneTransition {
|
||||
@Override
|
||||
public void transition(ContainerImpl container, ContainerEvent event) {
|
||||
ContainerKillEvent killEvent = (ContainerKillEvent) event;
|
||||
container.exitCode = killEvent.getContainerExitStatus();
|
||||
container.addDiagnostics(killEvent.getDiagnostic(), "\n");
|
||||
container.addDiagnostics("Container is killed before being launched.\n");
|
||||
container.metrics.killedContainer();
|
||||
NMAuditLogger.logSuccess(container.user,
|
||||
AuditConstants.FINISH_KILLED_CONTAINER, "ContainerImpl",
|
||||
container.containerId.getApplicationAttemptId().getApplicationId(),
|
||||
container.containerId);
|
||||
super.transition(container, event);
|
||||
if (container.recoveredStatus == RecoveredContainerStatus.COMPLETED) {
|
||||
container.sendFinishedEvents();
|
||||
} else {
|
||||
ContainerKillEvent killEvent = (ContainerKillEvent) event;
|
||||
container.exitCode = killEvent.getContainerExitStatus();
|
||||
container.addDiagnostics(killEvent.getDiagnostic(), "\n");
|
||||
container.addDiagnostics("Container is killed before being launched.\n");
|
||||
container.metrics.killedContainer();
|
||||
NMAuditLogger.logSuccess(container.user,
|
||||
AuditConstants.FINISH_KILLED_CONTAINER, "ContainerImpl",
|
||||
container.containerId.getApplicationAttemptId().getApplicationId(),
|
||||
container.containerId);
|
||||
super.transition(container, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue