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

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/CheckpointBarrierAligner.java
 ##########
 @@ -100,21 +105,20 @@ public boolean isBlocked(int channelIndex) {
        }
 
        @Override
-       public boolean processBarrier(CheckpointBarrier receivedBarrier, int 
channelIndex, long bufferedBytes) throws Exception {
+       public void processBarrier(CheckpointBarrier receivedBarrier, int 
channelIndex) throws Exception {
                final long barrierId = receivedBarrier.getId();
 
                // fast path for single channel cases
                if (totalNumberOfInputChannels == 1) {
                        if (barrierId > currentCheckpointId) {
                                // new checkpoint
                                currentCheckpointId = barrierId;
-                               notifyCheckpoint(receivedBarrier, 
bufferedBytes, latestAlignmentDurationNanos);
+                               notifyCheckpoint(receivedBarrier, 
latestAlignmentDurationNanos);
                        }
-                       return false;
+                       notifyCheckpointCompletedOrCanceled(barrierId);
 
 Review comment:
   For the case of `totalNumberOfInputChannels == 1`, it should be handled 
separately for fast path. Then I suggest moving this path as a separate method 
to make #processBarrier seem shorter, and also it can be reused by below 
`processCancellationBarrier` if providing a function argument.

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