From 62b95373329c64b90d266019f98f423f3c635351 Mon Sep 17 00:00:00 2001 From: Wangda Tan Date: Mon, 26 Mar 2018 11:19:15 -0700 Subject: [PATCH] YARN-8068. Application Priority field causes NPE in app timeline publish when Hadoop 2.7 based clients to 2.8+ (Sunil G via wangda) Change-Id: I7910bd1064a1b4dbbe2084080c060822ea6f3b48 (cherry picked from commit 9eef19b2ad78b8464da252d0e23c08675898b9d8) --- .../hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java index 61936bbc09a..4234e582573 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/RMAppImpl.java @@ -455,6 +455,11 @@ public class RMAppImpl implements RMApp, Recoverable { if (submissionContext.getPriority() != null) { this.applicationPriority = Priority .newInstance(submissionContext.getPriority().getPriority()); + } else { + // If incoming app does not have priority configured in submission + // context, system could be assume that its a 0 priority app and could be + // considered as normal. + this.applicationPriority = Priority.newInstance(0); } int globalMaxAppAttempts = conf.getInt(YarnConfiguration.RM_AM_MAX_ATTEMPTS,