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) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/733248ce Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/733248ce Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/733248ce Branch: refs/heads/YARN-8200 Commit: 733248cec721c3c65c77f891194bf2124eaa8cf3 Parents: a3c1735 Author: Sunil G <sun...@apache.org> Authored: Fri Apr 20 00:05:53 2018 +0530 Committer: Sunil G <sun...@apache.org> Committed: Fri Apr 20 12:12:26 2018 +0530 ---------------------------------------------------------------------- .../hadoop/yarn/server/resourcemanager/ResourceManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/733248ce/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java ---------------------------------------------------------------------- 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 844cc4c..6670cfd 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 { --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org