pnowojski commented on a change in pull request #8361: [FLINK-12434][network] 
Replace listeners with CompletableFuture in InputGates
URL: https://github.com/apache/flink/pull/8361#discussion_r282107387
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java
 ##########
 @@ -596,6 +600,12 @@ public void requestPartitions() throws IOException, 
InterruptedException {
                }
        }
 
+       private void resetIsAvailable() {
+               if (isAvailable.isDone()) {
 
 Review comment:
   Crap good point, I assumed that `CompletableFuture.completedFuture(null);` 
would be optimised to `boolean isDone() { return true; }` (via some subclass). 
   
   I would be a bit worried for hardcoding just `if (isAvailable == 
AVAILABLE)`, it took me couple of minutes to figure out if that's always 
correct, but I think equally fast check and more error prone would be:
   `if (isAvailable == AVAILABLE || isAvailable.isDone())`? Or am I missing 
something?
   
   And yes, this discussion/issue shows that this logic is not trivial and 
should be de-duplicated.

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