Copilot commented on code in PR #29574:
URL: https://github.com/apache/flink/pull/29574#discussion_r4354495105


##########
flink-state-backends/flink-statebackend-forst/src/main/java/org/apache/flink/state/forst/ForStStateExecutor.java:
##########
@@ -305,6 +311,14 @@ public void shutdown() {
         if (!sharedWriteThread) {
             shutdownAndWait(writeThreads);
         }
+        ForStDBIterRequest<?, ?, ?, ?, ?> iterRequest;
+        while ((iterRequest = cleanupIterRequests.poll()) != null) {
+            try {
+                iterRequest.close();

Review Comment:
   This cleanup can still race an active reader when shutdown is interrupted. 
`shutdownAndWait()` catches `InterruptedException`, calls `shutdownNow()`, and 
returns without confirming termination. A worker inside native iterator I/O 
need not stop on a Java interrupt, so this loop can free an iterator that the 
worker is still using. Continue waiting for actual executor termination before 
draining the queue, and restore the shutdown thread's interrupt status 
afterward. Add a regression test that interrupts shutdown while a reader 
remains active and verifies that its iterator is not closed until the reader 
stops.



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