diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java index 4be5e2ab6d8..b0afb23408d 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMAppManager.java @@ -208,7 +208,8 @@ public class RMAppManager implements EventHandler, == null ? "" : app.getApplicationSubmissionContext() - .getNodeLabelExpression()); + .getNodeLabelExpression()) + .add("diagnostics", app.getDiagnostics()); return summary; } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java index 1a04e6c56b4..bbe481eb94a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/TestAppManager.java @@ -844,6 +844,8 @@ public class TestAppManager{ new RMAppMetrics(Resource.newInstance(1234, 56), 10, 1, resourceSecondsMap, new HashMap()); when(app.getRMAppMetrics()).thenReturn(metrics); + when(app.getDiagnostics()).thenReturn(new StringBuilder( + "Multiline\n\n\r\rDiagnostics=Diagn,ostic")); RMAppManager.ApplicationSummary.SummaryBuilder summary = new RMAppManager.ApplicationSummary().createAppSummary(app); @@ -866,6 +868,8 @@ public class TestAppManager{ Assert.assertTrue(msg.contains("applicationType=MAPREDUCE")); Assert.assertTrue(msg.contains("applicationTags=tag1\\,tag2")); Assert.assertTrue(msg.contains("applicationNodeLabel=test")); + Assert.assertTrue(msg.contains("diagnostics=Multiline" + escaped + + "Diagnostics\\=Diagn\\,ostic")); } @Test