Repository: hadoop Updated Branches: refs/heads/branch-2.8 88b56cdfa -> d5ea2462c
YARN-4863. AHS Security login should be in serviceInit() instead of serviceStart(). Contributed by Junping Du (cherry picked from commit 80182809aed76fb9522d25db9bf5e445395dd573) (cherry picked from commit ffe01e05cdfe0c1484de0f2116014a63cdc51364) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/d5ea2462 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/d5ea2462 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/d5ea2462 Branch: refs/heads/branch-2.8 Commit: d5ea2462c287c01d4d984e61f47110e0d433401e Parents: 88b56cd Author: Xuan <[email protected]> Authored: Mon Mar 28 22:17:45 2016 -0700 Committer: Xuan <[email protected]> Committed: Mon Mar 28 22:21:31 2016 -0700 ---------------------------------------------------------------------- .../ApplicationHistoryServer.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/d5ea2462/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 d0af778..9bbcb4a 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); @@ -110,15 +117,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); - } - - if (pauseMonitor != null) { - pauseMonitor.start(); - } super.serviceStart(); startWebApp(); }
