YARN-9507. Fix NPE in NodeManager#serviceStop on startup failure. Contributed by Bilwa S T.

This commit is contained in:
Weiwei Yang 2019-06-03 14:09:37 +08:00
parent 2185249481
commit 4530f4500d
1 changed files with 5 additions and 3 deletions

View File

@ -526,9 +526,11 @@ public class NodeManager extends CompositeService
DefaultMetricsSystem.shutdown();
// Cleanup ResourcePluginManager
ResourcePluginManager rpm = context.getResourcePluginManager();
if (rpm != null) {
rpm.cleanup();
if (null != context) {
ResourcePluginManager rpm = context.getResourcePluginManager();
if (rpm != null) {
rpm.cleanup();
}
}
} finally {
// YARN-3641: NM's services stop get failed shouldn't block the