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

(cherry picked from commit e8cb2ae409)
This commit is contained in:
Ayush Saxena 2020-06-03 12:47:15 +05:30 committed by Wei-Chiu Chuang
parent d763c99707
commit fa30224e95
No known key found for this signature in database
GPG Key ID: B362E1C021854B9D
2 changed files with 5 additions and 1 deletions

View File

@ -2353,6 +2353,7 @@ public void shutdown() {
if (mbeanName != null) { if (mbeanName != null) {
MBeans.unregister(mbeanName); MBeans.unregister(mbeanName);
mbeanName = null;
} }
if (asyncDiskService != null) { if (asyncDiskService != null) {

View File

@ -1367,7 +1367,10 @@ void registerMBean(final String storageId) {
@Override @Override
public void shutdown() { public void shutdown() {
if (mbeanName != null) MBeans.unregister(mbeanName); if (mbeanName != null) {
MBeans.unregister(mbeanName);
mbeanName = null;
}
} }
@Override @Override