pnowojski commented on a change in pull request #6555: [FLINK-10142][network] 
reduce locking around credit notification
URL: https://github.com/apache/flink/pull/6555#discussion_r210916528
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/RemoteInputChannel.java
 ##########
 @@ -191,15 +191,15 @@ void retriggerSubpartitionRequest(int subpartitionIndex) 
throws IOException, Int
                checkError();
 
                final Buffer next;
-               final int remaining;
+               final boolean moreAvailable;
 
                synchronized (receivedBuffers) {
                        next = receivedBuffers.poll();
-                       remaining = receivedBuffers.size();
+                       moreAvailable = !receivedBuffers.isEmpty();
                }
 
                numBytesIn.inc(next.getSizeUnsafe());
-               return Optional.of(new BufferAndAvailability(next, remaining > 
0, getSenderBacklog()));
+               return Optional.of(new BufferAndAvailability(next, 
moreAvailable, getSenderBacklog()));
 
 Review comment:
   This has also nothing to do with `optimisations reducing lock contention`. 
Can you extract those changes to separate hotfix? If someone in the future will 
be looking at `git blame` regarding real `optimisations reducing lock 
contention` he will have the same "wtf" moments as me right now ;)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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