rpuch commented on code in PR #1280:
URL: https://github.com/apache/ignite-3/pull/1280#discussion_r1011294986


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/raft/snapshot/outgoing/SnapshotAwarePartitionDataStorage.java:
##########
@@ -123,11 +127,21 @@ private void handleSnapshotInterference(RowId rowId) {
 
     @Override
     public void close() throws Exception {
-        // TODO: IGNITE-17935 - terminate all snapshots of this partition 
considering correct locking to do it consistently
+        cleanupSnapshots();
 
         partitionStorage.close();
     }
 
+    private void cleanupSnapshots() {
+        PartitionSnapshots partitionSnapshots = getPartitionSnapshots();
+
+        try (AutoLockup ignored = partitionSnapshots.acquireReadLock()) {

Review Comment:
   The **object** is used by try-with-resources machinery, but the **variable** 
is not used inside `try` block. 
   
   Try to write something like the following in IDEA:
   
   ```
   try (var v = new FileOutputStream(...)) {
       ... some code
   }
   ```
   
   IDEA will immediately nag that `v` is not used. I want to avoid this 
behavior.



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

Reply via email to