HDFS-11041. Unable to unregister FsDatasetState MBean if DataNode is shutdown twice. Contributed by Wei-Chiu Chuang.

This commit is contained in:
Ayush Saxena 2020-06-03 12:47:15 +05:30
parent f6453244ab
commit e8cb2ae409
2 changed files with 5 additions and 1 deletions

View File

@ -2385,6 +2385,7 @@ class FsDatasetImpl implements FsDatasetSpi<FsVolumeImpl> {
if (mbeanName != null) {
MBeans.unregister(mbeanName);
mbeanName = null;
}
if (asyncDiskService != null) {

View File

@ -1367,7 +1367,10 @@ public class SimulatedFSDataset implements FsDatasetSpi<FsVolumeSpi> {
@Override
public void shutdown() {
if (mbeanName != null) MBeans.unregister(mbeanName);
if (mbeanName != null) {
MBeans.unregister(mbeanName);
mbeanName = null;
}
}
@Override