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

View File

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