Repository: hadoop
Updated Branches:
  refs/heads/branch-2 f74364e8b -> ffe01e05c


YARN-4863. AHS Security login should be in serviceInit() instead of 
serviceStart(). Contributed by Junping Du

(cherry picked from commit 80182809aed76fb9522d25db9bf5e445395dd573)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ffe01e05
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ffe01e05
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ffe01e05

Branch: refs/heads/branch-2
Commit: ffe01e05cdfe0c1484de0f2116014a63cdc51364
Parents: f74364e
Author: Xuan <xg...@apache.org>
Authored: Mon Mar 28 22:17:45 2016 -0700
Committer: Xuan <xg...@apache.org>
Committed: Mon Mar 28 22:18:56 2016 -0700

----------------------------------------------------------------------
 .../ApplicationHistoryServer.java                    | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ffe01e05/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
----------------------------------------------------------------------
diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
index cedbd2e..d241077 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-applicationhistoryservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/ApplicationHistoryServer.java
@@ -86,7 +86,14 @@ public class ApplicationHistoryServer extends 
CompositeService {
 
   @Override
   protected void serviceInit(Configuration conf) throws Exception {
-    // init timeline services first
+
+    // do security login first.
+    try {
+      doSecureLogin(conf);
+    } catch(IOException ie) {
+      throw new YarnRuntimeException("Failed to login", ie);
+    }
+    // init timeline services
     timelineStore = createTimelineStore(conf);
     addIfService(timelineStore);
     secretManagerService = 
createTimelineDelegationTokenSecretManagerService(conf);
@@ -111,12 +118,6 @@ public class ApplicationHistoryServer extends 
CompositeService {
 
   @Override
   protected void serviceStart() throws Exception {
-    try {
-      doSecureLogin(getConfig());
-    } catch(IOException ie) {
-      throw new YarnRuntimeException("Failed to login", ie);
-    }
-
     super.serviceStart();
     startWebApp();
   }

Reply via email to