jojochuang commented on code in PR #9840:
URL: https://github.com/apache/ozone/pull/9840#discussion_r3018984027
##########
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:
this is not guaranteed to be correct without a synchronized close, or
declare mBean as a 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]