YARN-3457. NPE when NodeManager.serviceInit fails and stopRecoveryStore called. Contributed by Bibin A Chundatt.

(cherry picked from commit dd852f5b8c)
This commit is contained in:
Tsuyoshi Ozawa 2015-04-08 15:56:18 +09:00
parent f9fbde3074
commit ac32fa187c
2 changed files with 15 additions and 10 deletions

View File

@ -105,6 +105,9 @@ Release 2.8.0 - UNRELEASED
YARN-3110. Few issues in ApplicationHistory web ui. (Naganarasimha G R via xgong) YARN-3110. Few issues in ApplicationHistory web ui. (Naganarasimha G R via xgong)
YARN-3457. NPE when NodeManager.serviceInit fails and stopRecoveryStore called.
(Bibin A Chundatt via ozawa)
Release 2.7.0 - UNRELEASED Release 2.7.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -176,11 +176,12 @@ public class NodeManager extends CompositeService
private void stopRecoveryStore() throws IOException { private void stopRecoveryStore() throws IOException {
nmStore.stop(); nmStore.stop();
if (null != context) {
if (context.getDecommissioned() && nmStore.canRecover()) { if (context.getDecommissioned() && nmStore.canRecover()) {
LOG.info("Removing state store due to decommission"); LOG.info("Removing state store due to decommission");
Configuration conf = getConfig(); Configuration conf = getConfig();
Path recoveryRoot = new Path( Path recoveryRoot =
conf.get(YarnConfiguration.NM_RECOVERY_DIR)); new Path(conf.get(YarnConfiguration.NM_RECOVERY_DIR));
LOG.info("Removing state store at " + recoveryRoot LOG.info("Removing state store at " + recoveryRoot
+ " due to decommission"); + " due to decommission");
FileSystem recoveryFs = FileSystem.getLocal(conf); FileSystem recoveryFs = FileSystem.getLocal(conf);
@ -189,6 +190,7 @@ public class NodeManager extends CompositeService
} }
} }
} }
}
private void recoverTokens(NMTokenSecretManagerInNM nmTokenSecretManager, private void recoverTokens(NMTokenSecretManagerInNM nmTokenSecretManager,
NMContainerTokenSecretManager containerTokenSecretManager) NMContainerTokenSecretManager containerTokenSecretManager)