zhijiangW commented on a change in pull request #11786: [FLINK-17208][network] Reduce redundant data available notifications of PipelinedSubpartition URL: https://github.com/apache/flink/pull/11786#discussion_r410374050
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/PipelinedSubpartition.java ########## @@ -367,8 +377,9 @@ public void flush() { } // if there is more then 1 buffer, we already notified the reader // (at the latest when adding the second buffer) - notifyDataAvailable = !flushRequested && buffers.size() == 1 && buffers.peek().isDataAvailable(); + notifyDataAvailable = mayNotifyDataAvailable() && buffers.peekFirst().isDataAvailable(); flushRequested = flushRequested || buffers.size() > 1 || notifyDataAvailable; Review comment: it would change the behavior of `flushRequested` here. The `flushRequested` is mainly used for judging the availability of partition called by upper component, so it should not be coupled with the condition of `dataAvailableNotified`. E.g. if `flushRequested = false` and `buffers.size() == 1` and `buffers.peek().isDataAvailable()`, no matter with `dataAvailableNotified` is false or true, the new `flushRequested` should alway be true. ---------------------------------------------------------------- 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 With regards, Apache Git Services