diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index d5a4b0d5315..ee3a197475c 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -431,6 +431,9 @@ Release 2.8.0 - UNRELEASED YARN-3740. Fixed the typo in the configuration name: APPLICATION_HISTORY_PREFIX_MAX_APPS. (Xuan Gong via zjshen) + YARN-3751. Fixed AppInfo to check if used resources are null. (Sunil G via + zjshen) + Release 2.7.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java index 0cc5f756457..8f332a4cdd4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/webapp/dao/AppInfo.java @@ -86,12 +86,14 @@ public class AppInfo { elapsedTime = Times.elapsed(startedTime, finishedTime); finalAppStatus = app.getFinalApplicationStatus(); if (app.getApplicationResourceUsageReport() != null) { - runningContainers = - app.getApplicationResourceUsageReport().getNumUsedContainers(); - allocatedCpuVcores = app.getApplicationResourceUsageReport() - .getUsedResources().getVirtualCores(); - allocatedMemoryMB = app.getApplicationResourceUsageReport() - .getUsedResources().getMemory(); + runningContainers = app.getApplicationResourceUsageReport() + .getNumUsedContainers(); + if (app.getApplicationResourceUsageReport().getUsedResources() != null) { + allocatedCpuVcores = app.getApplicationResourceUsageReport() + .getUsedResources().getVirtualCores(); + allocatedMemoryMB = app.getApplicationResourceUsageReport() + .getUsedResources().getMemory(); + } } progress = app.getProgress() * 100; // in percent if (app.getApplicationTags() != null && !app.getApplicationTags().isEmpty()) {