You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/08/09 09:58:25 UTC

[GitHub] [ozone] rakeshadr commented on a diff in pull request #3560: HDDS-6581. Introduce KEY_PATH_LOCK in OMKeyCreateRequest class

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org