HDFS-12426. Ozone: BlockManager MBean unregister failure upon shutdown. Contributed by Lokesh Jain.

This commit is contained in:
Xiaoyu Yao 2017-09-14 14:54:16 -07:00 committed by Owen O'Malley
parent f66a522695
commit cf841286b8
1 changed files with 5 additions and 2 deletions

View File

@ -105,7 +105,7 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
Map<String, BlockContainerInfo>> containers;
private final int containerProvisionBatchSize;
private final Random rand;
private final ObjectName mxBean;
private ObjectName mxBean;
/**
@ -588,7 +588,10 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
deletedBlockLog.close();
}
blockDeletingService.shutdown();
MBeans.unregister(mxBean);
if (mxBean != null) {
MBeans.unregister(mxBean);
mxBean = null;
}
}
@Override