akalash commented on code in PR #19499:
URL: https://github.com/apache/flink/pull/19499#discussion_r894429639


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java:
##########
@@ -676,7 +726,9 @@ private void returnExcessMemorySegments() {
     }
 
     private boolean hasExcessBuffers() {
-        return numberOfRequestedMemorySegments > currentPoolSize;
+        return numberOfRequestedOverdraftMemorySegments > 0
+                || numberOfRequestedMemorySegments + 
numberOfRequestedOverdraftMemorySegments
+                        > currentPoolSize;

Review Comment:
   I think you overcomplicated the condition I believe this is an easier 
equivalent:
   ```
   private boolean hasExcessBuffers() {
           return numberOfRequestedOverdraftMemorySegments > 0
                   || numberOfRequestedMemorySegments > currentPoolSize;
       }
   ```



##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java:
##########
@@ -424,6 +452,24 @@ private boolean requestMemorySegmentFromGlobal() {
         return false;
     }
 
+    private MemorySegment requestOverdraftMemorySegmentFromGlobal(int 
targetChannel) {

Review Comment:
   It looks like `targetChannel` can be removed here since there is no usage of 
this parameter



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to