anuengineer commented on a change in pull request #1016: HDDS-1672. Improve
locking in OzoneManager.
URL: https://github.com/apache/hadoop/pull/1016#discussion_r298345576
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/BucketManagerImpl.java
##########
@@ -114,9 +115,11 @@ public void createBucket(OmBucketInfo bucketInfo) throws
IOException {
Preconditions.checkNotNull(bucketInfo);
String volumeName = bucketInfo.getVolumeName();
String bucketName = bucketInfo.getBucketName();
- metadataManager.getLock().acquireVolumeLock(volumeName);
- metadataManager.getLock().acquireBucketLock(volumeName, bucketName);
+ boolean acquiredBucketLock = false;
+ metadataManager.getLock().acquireLock(VOLUME_LOCK, volumeName);
Review comment:
There is a subtle bug here. We either need to assume that acquireLock cannot
fail, or assume that it can fail.
If it cannot fail: Then the finally is simple, you can release bucket and
volume lock.
if it can fail: Then it is possible the acquire volume lock is going to fail
-- and there is no handling -- I am presuming that it will throw up into the
calling unction and there is some sort of a handler there ? if that is the
case, what will it throw ? I am not sure it can fail -- @arp7 comments?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]