Skip to content

Commit 4ff973f

Browse files
author
Jonathan Eagles
committed
YARN-4422. Generic AHS sometimes doesn't show started, node, or logs on App page (Eric Payne via jeagles)
1 parent 4546c75 commit 4ff973f

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

hadoop-yarn-project/CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,9 @@ Release 2.7.3 - UNRELEASED
11491149
(with application having id > 9999) (Mohammad Shahid Khan & Varun Saxena
11501150
via jianhe)
11511151

1152+
YARN-4422. Generic AHS sometimes doesn't show started, node, or logs on App page
1153+
(Eric Payne via jeagles)
1154+
11521155
Release 2.7.2 - UNRELEASED
11531156

11541157
INCOMPATIBLE CHANGES

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryManagerOnTimelineStore.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,13 @@ private static ApplicationAttemptReport convertToApplicationAttemptReport(
488488
AppAttemptMetricsConstants.STATE_EVENT_INFO)
489489
.toString());
490490
}
491+
if (eventInfo
492+
.containsKey(AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO)) {
493+
amContainerId =
494+
ConverterUtils.toContainerId(eventInfo.get(
495+
AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO)
496+
.toString());
497+
}
491498
}
492499
}
493500
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/AppAttemptFinishedEvent.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.apache.hadoop.yarn.server.resourcemanager.metrics;
2020

2121
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
22+
import org.apache.hadoop.yarn.api.records.ContainerId;
2223
import org.apache.hadoop.yarn.api.records.FinalApplicationStatus;
2324
import org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState;
2425

@@ -31,6 +32,7 @@ public class AppAttemptFinishedEvent extends
3132
private String diagnosticsInfo;
3233
private FinalApplicationStatus appStatus;
3334
private YarnApplicationAttemptState state;
35+
private ContainerId masterContainerId;
3436

3537
public AppAttemptFinishedEvent(
3638
ApplicationAttemptId appAttemptId,
@@ -39,7 +41,8 @@ public AppAttemptFinishedEvent(
3941
String diagnosticsInfo,
4042
FinalApplicationStatus appStatus,
4143
YarnApplicationAttemptState state,
42-
long finishedTime) {
44+
long finishedTime,
45+
ContainerId masterContainerId) {
4346
super(SystemMetricsEventType.APP_ATTEMPT_FINISHED, finishedTime);
4447
this.appAttemptId = appAttemptId;
4548
// This is the tracking URL after the application attempt is finished
@@ -48,6 +51,7 @@ public AppAttemptFinishedEvent(
4851
this.diagnosticsInfo = diagnosticsInfo;
4952
this.appStatus = appStatus;
5053
this.state = state;
54+
this.masterContainerId = masterContainerId;
5155
}
5256

5357
@Override
@@ -79,4 +83,8 @@ public YarnApplicationAttemptState getYarnApplicationAttemptState() {
7983
return state;
8084
}
8185

86+
public ContainerId getMasterContainerId() {
87+
return masterContainerId;
88+
}
89+
8290
}

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/SystemMetricsPublisher.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public void appAttemptFinished(RMAppAttempt appAttempt,
186186
// based on app state if it doesn't exist
187187
app.getFinalApplicationStatus(),
188188
RMServerUtils.createApplicationAttemptState(appAttemtpState),
189-
finishedTime));
189+
finishedTime,
190+
appAttempt.getMasterContainer().getId()));
190191
}
191192
}
192193

@@ -416,6 +417,9 @@ private void publishAppAttemptFinishedEvent(AppAttemptFinishedEvent event) {
416417
event.getFinalApplicationStatus().toString());
417418
eventInfo.put(AppAttemptMetricsConstants.STATE_EVENT_INFO,
418419
event.getYarnApplicationAttemptState().toString());
420+
eventInfo.put(
421+
AppAttemptMetricsConstants.MASTER_CONTAINER_EVENT_INFO,
422+
event.getMasterContainerId().toString());
419423
tEvent.setEventInfo(eventInfo);
420424
entity.addEvent(tEvent);
421425
putEntity(entity);

0 commit comments

Comments
 (0)