diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index a4673bdc2dc..d9e1754c8ef 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -105,6 +105,9 @@ Release 2.8.0 - UNRELEASED 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 INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java index 5727f102d4b..d54180a3627 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/java/org/apache/hadoop/yarn/server/nodemanager/NodeManager.java @@ -176,16 +176,18 @@ public class NodeManager extends CompositeService private void stopRecoveryStore() throws IOException { nmStore.stop(); - if (context.getDecommissioned() && nmStore.canRecover()) { - LOG.info("Removing state store due to decommission"); - Configuration conf = getConfig(); - Path recoveryRoot = new Path( - conf.get(YarnConfiguration.NM_RECOVERY_DIR)); - LOG.info("Removing state store at " + recoveryRoot - + " due to decommission"); - FileSystem recoveryFs = FileSystem.getLocal(conf); - if (!recoveryFs.delete(recoveryRoot, true)) { - LOG.warn("Unable to delete " + recoveryRoot); + if (null != context) { + if (context.getDecommissioned() && nmStore.canRecover()) { + LOG.info("Removing state store due to decommission"); + Configuration conf = getConfig(); + Path recoveryRoot = + new Path(conf.get(YarnConfiguration.NM_RECOVERY_DIR)); + LOG.info("Removing state store at " + recoveryRoot + + " due to decommission"); + FileSystem recoveryFs = FileSystem.getLocal(conf); + if (!recoveryFs.delete(recoveryRoot, true)) { + LOG.warn("Unable to delete " + recoveryRoot); + } } } }