YARN-9197. Add safe guard against NPE for component instance failure.
Contributed by kyungwan nam
This commit is contained in:
parent
dacc1a759e
commit
8c7f6b2d4d
|
@ -350,8 +350,10 @@ public class ComponentInstance implements EventHandler<ComponentInstanceEvent>,
|
|||
// record in ATS
|
||||
LOG.info("Publishing component instance status {} {} ",
|
||||
event.getContainerId(), containerState);
|
||||
int exitStatus = failureBeforeLaunch || event.getStatus() == null ?
|
||||
ContainerExitStatus.INVALID : event.getStatus().getExitStatus();
|
||||
compInstance.serviceTimelinePublisher.componentInstanceFinished(
|
||||
event.getContainerId(), event.getStatus().getExitStatus(),
|
||||
event.getContainerId(), exitStatus,
|
||||
containerState, containerDiag);
|
||||
}
|
||||
|
||||
|
@ -366,8 +368,10 @@ public class ComponentInstance implements EventHandler<ComponentInstanceEvent>,
|
|||
|
||||
if (compInstance.timelineServiceEnabled) {
|
||||
// record in ATS
|
||||
int exitStatus = failureBeforeLaunch || event.getStatus() == null ?
|
||||
ContainerExitStatus.INVALID : event.getStatus().getExitStatus();
|
||||
compInstance.serviceTimelinePublisher.componentInstanceFinished(
|
||||
event.getContainerId(), event.getStatus().getExitStatus(),
|
||||
event.getContainerId(), exitStatus,
|
||||
containerState, containerDiag);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue