rakeshadr commented on code in PR #3560:
URL: https://github.com/apache/ozone/pull/3560#discussion_r941143770


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneLockStrategy.java:
##########
@@ -31,19 +31,16 @@
  */
 public interface OzoneLockStrategy {
   boolean acquireWriteLock(OMMetadataManager omMetadataManager,
-                           OzoneManagerLock.Resource resource,
                            String volumeName, String bucketName, String 
keyName)

Review Comment:
   @tanvipenumudy IMO, Exception throws clause is not required in the release 
function/API. In general, releasing logic should handle all the exceptions 
within itself otherwise it can leads to leaking of resources. For example, what 
happens if any exception thrown and lock is not released, which can leads to 
resource leaks, isn't it.
   
   Could you please remove the `throws IOException` from the release lock 
interface and its impl classes. Thanks!
   
   ```
   OzoneLockStrategy.java 
   
     void releaseWriteLock(OMMetadataManager omMetadataManager,
                           OzoneManagerLock.Resource resource, String 
volumeName,
                           String bucketName, String keyName);
   
     void releaseReadLock(OMMetadataManager omMetadataManager,
                          OzoneManagerLock.Resource resource, String volumeName,
                          String bucketName, String keyName);
   ```



-- 
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