YARN-4623. TestSystemMetricsPublisher#testPublishAppAttemptMetricsForUnmanagedAM fails with NPE on branch-2.7. Contributed by Naganarasimha G R.

This commit is contained in:
Junping Du 2016-01-21 10:52:15 -08:00
parent 63bb912749
commit 83fd33d5fe
2 changed files with 6 additions and 1 deletions

View File

@ -72,6 +72,9 @@ Release 2.7.3 - UNRELEASED
YARN-4610. Reservations continue looking for one app causes other apps to
starve (jlowe)
YARN-4623. TestSystemMetricsPublisher#testPublishAppAttemptMetricsForUnmanagedAM
fails with NPE on branch-2.7. (Naganarasimha G R via junping_du)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -160,6 +160,8 @@ public class SystemMetricsPublisher extends CompositeService {
public void appAttemptFinished(RMAppAttempt appAttempt,
RMAppAttemptState appAttemtpState, RMApp app, long finishedTime) {
if (publishSystemMetrics) {
ContainerId container = (appAttempt.getMasterContainer() == null) ? null
: appAttempt.getMasterContainer().getId();
dispatcher.getEventHandler().handle(
new AppAttemptFinishedEvent(
appAttempt.getAppAttemptId(),
@ -171,7 +173,7 @@ public class SystemMetricsPublisher extends CompositeService {
app.getFinalApplicationStatus(),
RMServerUtils.createApplicationAttemptState(appAttemtpState),
finishedTime,
appAttempt.getMasterContainer().getId()));
container));
}
}