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

This commit is contained in:
Xuan 2016-03-28 22:17:45 -07:00
parent 1f004b3367
commit 80182809ae

View File

@ -86,7 +86,14 @@ public ApplicationHistoryServer() {
@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 @@ protected void serviceInit(Configuration conf) throws Exception {
@Override
protected void serviceStart() throws Exception {
try {
doSecureLogin(getConfig());
} catch(IOException ie) {
throw new YarnRuntimeException("Failed to login", ie);
}
super.serviceStart();
startWebApp();
}