YARN-3537. NPE when NodeManager.serviceInit fails and stopRecoveryStore invoked. Contributed by Brahma Reddy Battula
(cherry picked from commit 5e093f0d40
)
This commit is contained in:
parent
73ba3ebe7c
commit
cf4154676b
|
@ -245,6 +245,9 @@ Release 2.7.1 - UNRELEASED
|
||||||
YARN-3522. Fixed DistributedShell to instantiate TimeLineClient as the
|
YARN-3522. Fixed DistributedShell to instantiate TimeLineClient as the
|
||||||
correct user. (Zhijie Shen via jianhe)
|
correct user. (Zhijie Shen via jianhe)
|
||||||
|
|
||||||
|
YARN-3537. NPE when NodeManager.serviceInit fails and stopRecoveryStore
|
||||||
|
invoked (Brahma Reddy Battula via jlowe)
|
||||||
|
|
||||||
Release 2.7.0 - 2015-04-20
|
Release 2.7.0 - 2015-04-20
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -177,18 +177,20 @@ public class NodeManager extends CompositeService
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopRecoveryStore() throws IOException {
|
private void stopRecoveryStore() throws IOException {
|
||||||
nmStore.stop();
|
if (null != nmStore) {
|
||||||
if (null != context) {
|
nmStore.stop();
|
||||||
if (context.getDecommissioned() && nmStore.canRecover()) {
|
if (null != context) {
|
||||||
LOG.info("Removing state store due to decommission");
|
if (context.getDecommissioned() && nmStore.canRecover()) {
|
||||||
Configuration conf = getConfig();
|
LOG.info("Removing state store due to decommission");
|
||||||
Path recoveryRoot =
|
Configuration conf = getConfig();
|
||||||
new Path(conf.get(YarnConfiguration.NM_RECOVERY_DIR));
|
Path recoveryRoot =
|
||||||
LOG.info("Removing state store at " + recoveryRoot
|
new Path(conf.get(YarnConfiguration.NM_RECOVERY_DIR));
|
||||||
+ " due to decommission");
|
LOG.info("Removing state store at " + recoveryRoot
|
||||||
FileSystem recoveryFs = FileSystem.getLocal(conf);
|
+ " due to decommission");
|
||||||
if (!recoveryFs.delete(recoveryRoot, true)) {
|
FileSystem recoveryFs = FileSystem.getLocal(conf);
|
||||||
LOG.warn("Unable to delete " + recoveryRoot);
|
if (!recoveryFs.delete(recoveryRoot, true)) {
|
||||||
|
LOG.warn("Unable to delete " + recoveryRoot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue