Aitozi commented on a change in pull request #8467: [FLINK-12535][network] Make CheckpointBarrierHandler non-blocking URL: https://github.com/apache/flink/pull/8467#discussion_r287607989
########## File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamInputProcessor.java ########## @@ -206,27 +207,35 @@ public boolean processInput() throws Exception { } } - final BufferOrEvent bufferOrEvent = barrierHandler.getNextNonBlocked(); - if (bufferOrEvent != null) { - if (bufferOrEvent.isBuffer()) { - currentChannel = bufferOrEvent.getChannelIndex(); - currentRecordDeserializer = recordDeserializers[currentChannel]; - currentRecordDeserializer.setNextBuffer(bufferOrEvent.getBuffer()); - } - else { - // Event received - final AbstractEvent event = bufferOrEvent.getEvent(); - if (event.getClass() != EndOfPartitionEvent.class) { - throw new IOException("Unexpected event: " + event); + final Optional<BufferOrEvent> bufferOrEvent = barrierHandler.pollNext(); + if (bufferOrEvent.isPresent()) { + processBufferOrEvent(bufferOrEvent.get()); + } else { + if (!barrierHandler.isFinished()) { + barrierHandler.isAvailable().get(); Review comment: Does this means we will waste `the time of waiting for new data` delaying execute mail for the this roundtrip? ---------------------------------------------------------------- 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