pnowojski commented on a change in pull request #13529:
URL: https://github.com/apache/flink/pull/13529#discussion_r501762982



##########
File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/io/StreamTwoInputProcessor.java
##########
@@ -23,16 +23,12 @@
 import org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter;

Review comment:
       Ok, I see, and I agree that your change would increase usability of this 
code, protecting against those kind of bugs. However as you proposed it would 
currently add an extra `volatile` check. I think this could be addressed, by 
combining this check with anti-starvation check. However on the other hand...
   
   It looks like I have implemented it differently in the 
`StreamMultipleInputProcessor`, where I do not see such check at all, and the 
processor completely relies on the `InputStatus`, which all in all I think is 
easier way of handling this. `isAvailable()` is checked only after the first 
`processInput` call after being woken up:
   ```
   private int selectNextReadingInputIndex() {
        if (!inputSelectionHandler.isAnyInputAvailable()) {
                fullCheckAndSetAvailable();
        }
        ...
   }
   ``` 
   
   Regarding the documentation. `AvailabilityProvider` already has quite a bit 
of java docs, but maybe you could help updating it to avoid such confusion in 
the future?




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


Reply via email to