zhijiangW commented on a change in pull request #11877: URL: https://github.com/apache/flink/pull/11877#discussion_r425078522
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedSequenceNumberingViewReader.java ########## @@ -163,8 +172,15 @@ boolean hasBuffersAvailable() { return subpartitionView.isAvailable(Integer.MAX_VALUE); } - @Override - public BufferAndAvailability getNextBuffer() throws IOException { + private AddBacklogMessage getAddBacklogMessage() { + int backlog = subpartitionView.getAndResetUnannouncedBacklog(); + if (backlog > 0) { + return new AddBacklogMessage(receiverId, backlog, false); + } + return null; Review comment: I guess we should not expect `null` return here. As long as the code path enters `getAddBacklogMessage`, then we should guarantee that the respective backlog should be more than 0. Maybe add assert backlog instead? ---------------------------------------------------------------- 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: us...@infra.apache.org