wsry commented on a change in pull request #11877:
URL: https://github.com/apache/flink/pull/11877#discussion_r662004311



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/BufferManager.java
##########
@@ -83,8 +84,13 @@ public BufferManager(
     // ------------------------------------------------------------------------
 
     @Nullable
-    Buffer requestBuffer() {
+    Buffer requestBuffer(int initialCredit) {
         synchronized (bufferQueue) {
+            // decrease the number of buffers require to avoid the possibility 
of
+            // allocating more than required buffers after the buffer is taken
+            if (initialCredit == 0) {
+                --numRequiredBuffers;

Review comment:
       You are right, we should always decrease this value.




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to