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

(cherry picked from commit ac32fa187cf37e5a51fd579e052105662ab3c411)

Conflicts:

	hadoop-yarn-project/CHANGES.txt
This commit is contained in:
Jason Lowe 2015-05-13 19:19:02 +00:00
parent 9527cdd12d
commit bfd28d6f7e
2 changed files with 15 additions and 10 deletions

View File

@ -86,6 +86,9 @@ Release 2.7.1 - UNRELEASED
YARN-3626. On Windows localized resources are not moved to the front
of the classpath when they should be. (Craig Welch via xgong)
YARN-3457. NPE when NodeManager.serviceInit fails and stopRecoveryStore called.
(Bibin A Chundatt via ozawa)
Release 2.7.0 - 2015-04-20
INCOMPATIBLE CHANGES

View File

@ -159,16 +159,18 @@ private void initAndStartRecoveryStore(Configuration conf)
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);
}
}
}
}