zhijiangW commented on a change in pull request #9483: [FLINK-13767][task] 
Migrate isFinished method from AvailabilityListener to AsyncDataInput
URL: https://github.com/apache/flink/pull/9483#discussion_r320085530
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamTwoInputSelectableProcessor.java
 ##########
 @@ -194,23 +193,28 @@ public boolean processInput() throws Exception {
 
                int readingInputIndex = selectNextReadingInputIndex();
                if (readingInputIndex == -1) {
-                       return false;
+                       return InputStatus.NOTHING_AVAILABLE;
 
 Review comment:
   After double checking the logic in `MailBoxProcessor#runMailboxLoop`, it has 
the optimization logic of warming hot path via 
   ```
   if (!mailbox.hasMail()) {
        return true;
   }
   ```
   Then it would cause `selectNextReadingInputIndex` return -1 here, not only 
for the first call `processInput`. But it still does not exist the 
`END_OF_INPUT` case here.
   
   Another concern is that are there any experiments to verify this hot path 
optimization has benefits in practice? I wonder it might waste some cpu time 
and also a bit delay the valid processing after available notification.

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