maedhroz commented on code in PR #3575:
URL: https://github.com/apache/cassandra/pull/3575#discussion_r1800302921


##########
src/java/org/apache/cassandra/index/sai/plan/QueryController.java:
##########
@@ -168,6 +167,22 @@ public UnfilteredRowIterator queryStorage(PrimaryKey key, 
ReadExecutionControlle
         return partition.queryMemtableAndDisk(cfs, executionController);
     }
 
+    private static Runnable getIndexReleaser(Set<SSTableIndex> 
referencedIndexes)
+    {
+        return new Runnable()
+        {
+            boolean closed;
+            @Override
+            public void run()
+            {
+                if (closed)
+                    return;
+                closed = true;
+                referencedIndexes.forEach(SSTableIndex::releaseQuietly);
+            }
+        };
+    }

Review Comment:
   I wasn't able to reproduce the double close on the `KeyRangeIterator` w/ 
`AccordSingleNodeSAITest`. Is there an easier way? `BaseIterator` (which 
`FilteredPartitions` extends) does seem to check for double closure already. 
Sorry for the stream of consciousness...



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