wsry commented on a change in pull request #11351: [FLINK-16404][runtime] Solve 
the potential deadlock problem when reducing exclusive buffers to zero
URL: https://github.com/apache/flink/pull/11351#discussion_r402900689
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartition.java
 ##########
 @@ -197,13 +197,18 @@ BufferAndBacklog pollBuffer() {
                                return null;
                        }
 
+                       boolean isExactlyOnceCheckpointBarrier = 
buffer.getDataType().isExactlyOnceCheckpointBarrier();
+                       if (isExactlyOnceCheckpointBarrier) {
+                               readView.blockOnCheckpointBarrier();
+                       }
+
                        updateStatistics(buffer);
                        // Do not report last remaining buffer on buffers as 
available to read (assuming it's unfinished).
                        // It will be reported for reading either on flush or 
when the number of buffers in the queue
                        // will be 2 or more.
                        return new BufferAndBacklog(
                                buffer,
-                               isAvailableUnsafe(),
+                               isAvailableUnsafe() && 
!isExactlyOnceCheckpointBarrier,
 
 Review comment:
   the downstream task of LocalChannel will check this ```isAvailable``` state 
and decide whether to add the corresponding input channel to available queue 
again. 
   
   I will move this to constructor of BufferAndBacklog.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to