YARN-8407. Container launch exception in AM log should be printed in ERROR level. (Yesha Vora via wangda)

Change-Id: I154e873df1df3503a09c41d6b3874ca195af91d9
(cherry picked from commit 861095f761)
This commit is contained in:
Wangda Tan 2018-08-07 13:01:13 -07:00
parent 450c791ecf
commit f2768eaa38
1 changed files with 14 additions and 8 deletions

View File

@ -251,14 +251,20 @@ public class ComponentInstance implements EventHandler<ComponentInstanceEvent>,
// re-ask the failed container.
comp.requestContainers(1);
comp.reInsertPendingInstance(compInstance);
LOG.info(compInstance.getCompInstanceId()
+ ": {} completed. Reinsert back to pending list and requested " +
"a new container." + System.lineSeparator() +
" exitStatus={}, diagnostics={}.",
event.getContainerId(), failureBeforeLaunch ? null :
event.getStatus().getExitStatus(),
failureBeforeLaunch ? FAILED_BEFORE_LAUNCH_DIAG :
event.getStatus().getDiagnostics());
StringBuilder builder = new StringBuilder();
builder.append(compInstance.getCompInstanceId()).append(": ");
builder.append(event.getContainerId()).append(" completed. Reinsert back to pending list and requested ");
builder.append("a new container.").append(System.lineSeparator());
builder.append(" exitStatus=").append(failureBeforeLaunch ? null : event.getStatus().getExitStatus());
builder.append(", diagnostics=");
builder.append(failureBeforeLaunch ? FAILED_BEFORE_LAUNCH_DIAG : event.getStatus().getDiagnostics());
if (event.getStatus().getExitStatus() != 0) {
LOG.error(builder.toString());
} else {
LOG.info(builder.toString());
}
} else {
// When no relaunch, update component's #succeeded/#failed
// instances.