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

View File

@ -526,10 +526,12 @@ protected void serviceStop() throws Exception {
DefaultMetricsSystem.shutdown(); DefaultMetricsSystem.shutdown();
// Cleanup ResourcePluginManager // Cleanup ResourcePluginManager
if (null != context) {
ResourcePluginManager rpm = context.getResourcePluginManager(); ResourcePluginManager rpm = context.getResourcePluginManager();
if (rpm != null) { if (rpm != null) {
rpm.cleanup(); rpm.cleanup();
} }
}
} finally { } finally {
// YARN-3641: NM's services stop get failed shouldn't block the // YARN-3641: NM's services stop get failed shouldn't block the
// release of NMLevelDBStore. // release of NMLevelDBStore.