diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index c77d6b035d9..61715949f89 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -43,6 +43,9 @@ Release 2.7.3 - UNRELEASED (with application having id > 9999) (Mohammad Shahid Khan & Varun Saxena via jianhe) + YARN-4422. Generic AHS sometimes doesn't show started, node, or logs on App page + (Eric Payne via jeagles) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java index 44d159cc5eb..6ab5b4195dc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java @@ -418,6 +418,13 @@ public class ApplicationHistoryManagerOnTimelineStore extends AbstractService AppAttemptMetricsConstants.STATE_EVENT_INFO) .toString()); } + if (eventInfo + .containsKey(AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO)) { + amContainerId = + ConverterUtils.toContainerId(eventInfo.get( + AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO) + .toString()); + } } } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/AppAttemptFinishedEvent.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/AppAttemptFinishedEvent.java index 71d9363cd9a..fc1d10fee0e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/AppAttemptFinishedEvent.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/AppAttemptFinishedEvent.java @@ -19,6 +19,7 @@ package org.apache.hadoop.yarn.server.resourcemanager.metrics; import org.apache.hadoop.yarn.api.records.ApplicationAttemptId; +import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.FinalApplicationStatus; import org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState; @@ -31,6 +32,7 @@ public class AppAttemptFinishedEvent extends private String diagnosticsInfo; private FinalApplicationStatus appStatus; private YarnApplicationAttemptState state; + private ContainerId masterContainerId; public AppAttemptFinishedEvent( ApplicationAttemptId appAttemptId, @@ -39,7 +41,8 @@ public class AppAttemptFinishedEvent extends String diagnosticsInfo, FinalApplicationStatus appStatus, YarnApplicationAttemptState state, - long finishedTime) { + long finishedTime, + ContainerId masterContainerId) { super(SystemMetricsEventType.APP_ATTEMPT_FINISHED, finishedTime); this.appAttemptId = appAttemptId; // This is the tracking URL after the application attempt is finished @@ -48,6 +51,7 @@ public class AppAttemptFinishedEvent extends this.diagnosticsInfo = diagnosticsInfo; this.appStatus = appStatus; this.state = state; + this.masterContainerId = masterContainerId; } @Override @@ -79,4 +83,8 @@ public class AppAttemptFinishedEvent extends return state; } + public ContainerId getMasterContainerId() { + return masterContainerId; + } + } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java index b849b0035db..afb65996870 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java @@ -168,7 +168,8 @@ public class SystemMetricsPublisher extends CompositeService { // based on app state if it doesn't exist app.getFinalApplicationStatus(), RMServerUtils.createApplicationAttemptState(appAttemtpState), - finishedTime)); + finishedTime, + appAttempt.getMasterContainer().getId())); } } @@ -359,6 +360,9 @@ public class SystemMetricsPublisher extends CompositeService { event.getFinalApplicationStatus().toString()); eventInfo.put(AppAttemptMetricsConstants.STATE_EVENT_INFO, event.getYarnApplicationAttemptState().toString()); + eventInfo.put( + AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO, + event.getMasterContainerId().toString()); tEvent.setEventInfo(eventInfo); entity.addEvent(tEvent); putEntity(entity);