Russole commented on code in PR #9840:
URL: https://github.com/apache/ozone/pull/9840#discussion_r3035393334


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/ozone/upgrade/AbstractLayoutVersionManager.java:
##########
@@ -208,20 +240,17 @@ public LayoutFeature getFeature(int layoutVersion) {
 
   @Override
   public Iterable<LayoutFeature> unfinalizedFeatures() {
-    lock.readLock().lock();
-    try {
-      return new ArrayList<>(features
-          .tailMap(metadataLayoutVersion + 1)
-          .values());
-    } finally {
-      lock.readLock().unlock();
-    }
+    int mlv = requireState().metadataLayoutVersion;
+    return new ArrayList<>(features
+        .tailMap(mlv + 1)
+        .values());
   }
 
   @Override
   public void close() {
-    if (mBean != null) {
-      MBeans.unregister(mBean);
+    ObjectName bean = mBean;

Review Comment:
   Good point. Updated `mBean` to be volatile.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to