1996fanrui commented on code in PR #20151:
URL: https://github.com/apache/flink/pull/20151#discussion_r1082023420


##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/channel/ChannelStateWriteRequestExecutorImpl.java:
##########
@@ -51,27 +66,40 @@ class ChannelStateWriteRequestExecutorImpl implements 
ChannelStateWriteRequestEx
     private final Thread thread;
     private volatile Exception thrown = null;
     private volatile boolean wasClosed = false;
-    private final String taskName;
+
+    private final Map<SubtaskID, Queue<ChannelStateWriteRequest>> 
unreadyQueues =
+            new ConcurrentHashMap<>();
+
+    private final JobID jobID;
+    private final Set<SubtaskID> subtasks;
+    private final AtomicBoolean isRegistering = new AtomicBoolean(true);
+    private final int numberOfSubtasksShareFile;

Review Comment:
   This is code about `lock.wait()`, if we add the `lock.notifyAll()`, the 
`lock.wait()` will return directly. And the `request` is still null, 
`lock.wait` will be blocked again. So the `lock.notifyAll()` doesn't work. 
That's why I think the `thread.interrupt()` is enough here.
   
   ```
       private ChannelStateWriteRequest waitAndTakeUnsafe() throws 
InterruptedException {
           ChannelStateWriteRequest request;
           while (true) {
               request = deque.pollFirst();
               if (request == null) {
                   lock.wait();
               } else {
                   return request;
               }
           }
       }
   ```



-- 
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-unsubscr...@flink.apache.org

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

Reply via email to