You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by yi...@apache.org on 2022/08/07 12:35:28 UTC

[flink] branch master updated: [FLINK-28826][network] Avoid notifying too frequently when recycling buffers for BatchShuffleReadBufferPool

This is an automated email from the ASF dual-hosted git repository.

yingjie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new 05de0a295ef [FLINK-28826][network] Avoid notifying too frequently when recycling buffers for BatchShuffleReadBufferPool
05de0a295ef is described below

commit 05de0a295efe06ff342a211071fc3810fdd53a2e
Author: Yuxin Tan <ta...@gmail.com>
AuthorDate: Sun Aug 7 20:35:21 2022 +0800

    [FLINK-28826][network] Avoid notifying too frequently when recycling buffers for BatchShuffleReadBufferPool
    
    This closes #20461.
---
 .../org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPool.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPool.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPool.java
index e17a460f4bf..fc9aa1b0ef2 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPool.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/disk/BatchShuffleReadBufferPool.java
@@ -257,9 +257,12 @@ public class BatchShuffleReadBufferPool {
                 return;
             }
 
+            boolean shouldNotify =
+                    buffers.size() < numBuffersPerRequest
+                            && buffers.size() + segments.size() >= numBuffersPerRequest;
             buffers.addAll(segments);
             lastBufferOperationTimestamp = System.nanoTime();
-            if (buffers.size() >= numBuffersPerRequest) {
+            if (shouldNotify) {
                 buffers.notifyAll();
             }
         }