From 7d06806dfdeb3252ac0defe23e8c468eabfa8b5e Mon Sep 17 00:00:00 2001 From: Sunil G Date: Fri, 20 Apr 2018 00:05:53 +0530 Subject: [PATCH] YARN-6827. [ATS1/1.5] NPE exception while publishing recovering applications into ATS during RM restart. Contributed by Rohith Sharma K S. --- .../yarn/server/resourcemanager/ResourceManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java index a7d2fe8e5a..05745ec272 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java @@ -1273,8 +1273,6 @@ synchronized void transitionToStandby(boolean initialize) protected void serviceStart() throws Exception { if (this.rmContext.isHAEnabled()) { transitionToStandby(false); - } else { - transitionToActive(); } startWepApp(); @@ -1284,6 +1282,11 @@ protected void serviceStart() throws Exception { WebAppUtils.setRMWebAppPort(conf, port); } super.serviceStart(); + + // Non HA case, start after RM services are started. + if (!this.rmContext.isHAEnabled()) { + transitionToActive(); + } } protected void doSecureLogin() throws IOException {