From 733248cec721c3c65c77f891194bf2124eaa8cf3 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. (cherry picked from commit 7d06806dfdeb3252ac0defe23e8c468eabfa8b5e) --- .../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 844cc4c3cbc..6670cfde08b 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 @@ -1227,8 +1227,6 @@ public class ResourceManager extends CompositeService implements Recoverable { protected void serviceStart() throws Exception { if (this.rmContext.isHAEnabled()) { transitionToStandby(false); - } else { - transitionToActive(); } startWepApp(); @@ -1238,6 +1236,11 @@ public class ResourceManager extends CompositeService implements Recoverable { 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 {