pnowojski commented on code in PR #27861:
URL: https://github.com/apache/flink/pull/27861#discussion_r3023238364


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartition.java:
##########
@@ -456,7 +457,9 @@ public void release() {
     @Nullable
     BufferAndBacklog pollBuffer() {
         synchronized (buffers) {
-            if (isBlocked) {
+            // When blocked, only allow priority buffers (e.g. unaligned 
checkpoint barriers)
+            // to be polled. Data buffers remain blocked until 
resumeConsumption() is called.
+            if (isBlocked && buffers.getNumPriorityElements() == 0) {

Review Comment:
   Why do we need this change from this commit? Could you elaborate a bit more 
in the commit message?



##########
flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartitionWithReadViewTest.java:
##########
@@ -545,6 +545,80 @@ void testResumeBlockedEmptySubpartition() throws 
IOException, InterruptedExcepti
         assertNoNextBuffer(readView);
     }
 
+    @TestTemplate
+    void testPriorityEventBypassesBlockedSubpartition() throws Exception {
+        subpartition.setChannelStateWriter(ChannelStateWriter.NO_OP);
+
+        // Block the subpartition by consuming an aligned checkpoint barrier
+        blockSubpartitionByCheckpoint(1);
+        assertThat(availablityListener.getNumPriorityEvents()).isZero();
+
+        // While blocked, add an unaligned checkpoint barrier (priority event).
+        // Even though isBlocked=true, the priority event notification should 
NOT
+        // be suppressed — priority events must bypass blocking.

Review Comment:
   How can this happen in reality outside of the unit test? 🤔 



##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/LocalInputChannel.java:
##########
@@ -242,7 +247,63 @@ public Optional<BufferAndAvailability> getNextBuffer() 
throws IOException {
         checkError();
 
         if (!toBeConsumedBuffers.isEmpty()) {
-            return getBufferAndAvailability(toBeConsumedBuffers.removeFirst());
+            // If there is a pending priority event (e.g., unaligned 
checkpoint barrier), fetch it

Review Comment:
   I think this method has grown too much and should be split into smaller ones



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