smengcl commented on code in PR #9210:
URL: https://github.com/apache/ozone/pull/9210#discussion_r2471749045


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotCache.java:
##########
@@ -288,14 +288,26 @@ public void release(UUID key) {
    */
   public UncheckedAutoCloseableSupplier<OMLockDetails> lock() {
     return lock(() -> lock.acquireResourceWriteLock(SNAPSHOT_DB_LOCK),
-        () -> lock.releaseResourceWriteLock(SNAPSHOT_DB_LOCK));
+        () -> lock.releaseResourceWriteLock(SNAPSHOT_DB_LOCK), () -> 
cleanup(true));
   }
 
-  private UncheckedAutoCloseableSupplier<OMLockDetails> lock(
-      Supplier<OMLockDetails> lockFunction, Supplier<OMLockDetails> 
unlockFunction) {
+  /**
+   * Acquires a write lock on a specific snapshot database and returns an 
auto-closeble supplier for lock details.
+   * The lock ensures that the operations accessing the snapshot database are 
perfromed in a thread safe manner. The
+   * returned supplier automatically releases the lock acquired when closed, 
preveneting potential resource

Review Comment:
   typo
   ```suggestion
      * returned supplier automatically releases the lock acquired when closed, 
preventing potential resource
   ```



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