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 338a4d3eaab..2b806ddde89 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 @@ -227,8 +227,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 dfb49ba516d..a0817642b4e 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 @@ -1088,6 +1088,8 @@ public class TestAppManager extends AppManagerTestBase{ 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); @@ -1110,6 +1112,8 @@ public class TestAppManager extends AppManagerTestBase{ assertTrue(msg.contains("applicationType=MAPREDUCE")); assertTrue(msg.contains("applicationTags=tag1\\,tag2")); assertTrue(msg.contains("applicationNodeLabel=test")); + assertTrue(msg.contains("diagnostics=Multiline" + escaped + + "Diagnostics\\=Diagn\\,ostic")); } @Test