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

(cherry picked from commit e8cb2ae409)

Change-Id: I9f04082d650628bc1b8b62dacaaf472f8a578742
This commit is contained in:
Ayush Saxena 2020-06-03 12:47:15 +05:30 committed by Steve Loughran
parent c6b9fcfd6c
commit 51b3a5b22c
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
2 changed files with 5 additions and 1 deletions

View File

@ -2353,6 +2353,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