YARN-7607. Remove the trailing duplicated timestamp in container diagnostics message. Contributed by Weiwei Yang.

This commit is contained in:
Weiwei Yang 2017-12-07 17:29:40 +08:00
parent c2e8a5c229
commit e411dd6666

View File

@ -1541,7 +1541,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
ContainerExitEvent exitEvent = (ContainerExitEvent) event;
container.exitCode = exitEvent.getExitCode();
if (exitEvent.getDiagnosticInfo() != null) {
container.addDiagnostics(exitEvent.getDiagnosticInfo(), "\n");
container.addDiagnostics(exitEvent.getDiagnosticInfo() + "\n");
}
// TODO: Add containerWorkDir to the deletion service.
@ -1578,7 +1578,7 @@ public ContainerState transition(final ContainerImpl container,
container.addDiagnostics("Diagnostic message from attempt "
+ n + " : ", "\n");
}
container.addDiagnostics(exitEvent.getDiagnosticInfo(), "\n");
container.addDiagnostics(exitEvent.getDiagnosticInfo() + "\n");
}
if (container.shouldRetry(container.exitCode)) {
@ -1737,7 +1737,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
ContainerResourceFailedEvent rsrcFailedEvent =
(ContainerResourceFailedEvent) event;
container.addDiagnostics(rsrcFailedEvent.getDiagnosticMessage(), "\n");
container.addDiagnostics(rsrcFailedEvent.getDiagnosticMessage() + "\n");
// Inform the localizer to decrement reference counts and cleanup
// resources.
@ -1760,7 +1760,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
container.metrics.endInitingContainer();
ContainerKillEvent killEvent = (ContainerKillEvent) event;
container.exitCode = killEvent.getContainerExitStatus();
container.addDiagnostics(killEvent.getDiagnostic(), "\n");
container.addDiagnostics(killEvent.getDiagnostic() + "\n");
container.addDiagnostics("Container is killed before being launched.\n");
}
}
@ -1799,7 +1799,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
new ContainersLauncherEvent(container,
ContainersLauncherEventType.CLEANUP_CONTAINER));
ContainerKillEvent killEvent = (ContainerKillEvent) event;
container.addDiagnostics(killEvent.getDiagnostic(), "\n");
container.addDiagnostics(killEvent.getDiagnostic() + "\n");
container.exitCode = killEvent.getContainerExitStatus();
}
}
@ -1838,7 +1838,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
}
if (exitEvent.getDiagnosticInfo() != null) {
container.addDiagnostics(exitEvent.getDiagnosticInfo(), "\n");
container.addDiagnostics(exitEvent.getDiagnosticInfo() + "\n");
}
// The process/process-grp is killed. Decrement reference counts and
@ -1890,7 +1890,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
} else {
ContainerKillEvent killEvent = (ContainerKillEvent) event;
container.exitCode = killEvent.getContainerExitStatus();
container.addDiagnostics(killEvent.getDiagnostic(), "\n");
container.addDiagnostics(killEvent.getDiagnostic() + "\n");
container.addDiagnostics("Container is killed before being launched.\n");
container.metrics.killedContainer();
NMAuditLogger.logSuccess(container.user,
@ -2010,7 +2010,7 @@ static class ContainerDiagnosticsUpdateTransition implements
public void transition(ContainerImpl container, ContainerEvent event) {
ContainerDiagnosticsUpdateEvent updateEvent =
(ContainerDiagnosticsUpdateEvent) event;
container.addDiagnostics(updateEvent.getDiagnosticsUpdate(), "\n");
container.addDiagnostics(updateEvent.getDiagnosticsUpdate() + "\n");
}
}
@ -2028,7 +2028,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
new ContainersLauncherEvent(container,
ContainersLauncherEventType.PAUSE_CONTAINER));
ContainerPauseEvent pauseEvent = (ContainerPauseEvent) event;
container.addDiagnostics(pauseEvent.getDiagnostic(), "\n");
container.addDiagnostics(pauseEvent.getDiagnostic() + "\n");
}
}
@ -2061,7 +2061,7 @@ public void transition(ContainerImpl container, ContainerEvent event) {
new ContainersLauncherEvent(container,
ContainersLauncherEventType.RESUME_CONTAINER));
ContainerResumeEvent resumeEvent = (ContainerResumeEvent) event;
container.addDiagnostics(resumeEvent.getDiagnostic(), "\n");
container.addDiagnostics(resumeEvent.getDiagnostic() + "\n");
}
}