From df36edf751202db00d8f43103d7120ec56d70a04 Mon Sep 17 00:00:00 2001 From: Vinod Kumar Vavilapalli Date: Fri, 7 Nov 2014 19:43:55 -0800 Subject: [PATCH] YARN-2826. Fixed user-groups mappings' refresh bug caused by YARN-2826. Contributed by Wangda Tan. --- hadoop-yarn-project/CHANGES.txt | 3 ++ .../resourcemanager/ResourceManager.java | 32 +++++++++---------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index d4c882719c..1e6406a9a2 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -914,6 +914,9 @@ Release 2.6.0 - UNRELEASED YARN-2819. NPE in ATS Timeline Domains when upgrading from 2.4 to 2.6. (Zhijie Shen via xgong) + YARN-2826. Fixed user-groups mappings' refresh bug caused by YARN-2826. + (Wangda Tan via vinodkv) + Release 2.5.2 - UNRELEASED INCOMPATIBLE CHANGES 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 4051054fe5..e0840b64bd 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 @@ -194,22 +194,6 @@ protected void serviceInit(Configuration conf) throws Exception { this.conf = conf; this.rmContext = new RMContextImpl(); - // Set HA configuration should be done before login - this.rmContext.setHAEnabled(HAUtil.isHAEnabled(this.conf)); - if (this.rmContext.isHAEnabled()) { - HAUtil.verifyAndSetConfiguration(this.conf); - } - - // Set UGI and do login - // If security is enabled, use login user - // If security is not enabled, use current user - this.rmLoginUGI = UserGroupInformation.getCurrentUser(); - try { - doSecureLogin(); - } catch(IOException ie) { - throw new YarnRuntimeException("Failed to login", ie); - } - this.configurationProvider = ConfigurationProviderFactory.getConfigurationProvider(conf); this.configurationProvider.init(this.conf); @@ -242,6 +226,22 @@ protected void serviceInit(Configuration conf) throws Exception { } validateConfigs(this.conf); + + // Set HA configuration should be done before login + this.rmContext.setHAEnabled(HAUtil.isHAEnabled(this.conf)); + if (this.rmContext.isHAEnabled()) { + HAUtil.verifyAndSetConfiguration(this.conf); + } + + // Set UGI and do login + // If security is enabled, use login user + // If security is not enabled, use current user + this.rmLoginUGI = UserGroupInformation.getCurrentUser(); + try { + doSecureLogin(); + } catch(IOException ie) { + throw new YarnRuntimeException("Failed to login", ie); + } // register the handlers for all AlwaysOn services using setupDispatcher(). rmDispatcher = setupDispatcher();