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:
parent
f9fbde3074
commit
ac32fa187c
|
@ -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
|
||||||
|
|
|
@ -176,16 +176,18 @@ public class NodeManager extends CompositeService
|
||||||
|
|
||||||
private void stopRecoveryStore() throws IOException {
|
private void stopRecoveryStore() throws IOException {
|
||||||
nmStore.stop();
|
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 = new Path(
|
Configuration conf = getConfig();
|
||||||
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