pnowojski commented on a change in pull request #17075:
URL: https://github.com/apache/flink/pull/17075#discussion_r699878543



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java
##########
@@ -457,6 +458,13 @@ public void setBufferPool(BufferPool bufferPool) {
     /** Assign the exclusive buffers to all remote input channels directly for 
credit-based mode. */
     @VisibleForTesting
     public void setupChannels() throws IOException {
+        // A floating buffer is allocated here to avoid potential deadlock and 
guarantee that it
+        // can make progress when the exclusive buffer is 0. See FLINK-24035 
for more information.
+        // Note: An exception will be thrown if there is no buffer available 
in the given timeout.
+        bufferPool.reserveSegments(1);
+
+        // The exclusive buffers are allocated here per channel and similar to 
the above floating
+        // one, an exception will be thrown if it can not get enough buffers 
in the given timeout.

Review comment:
       ```suggestion
           // Allocate enough exclusive and floating buffers to guarantee that 
job can make a progress.
           // Note: An exception will be thrown if there is no buffer available 
in the given timeout.
           
           // First allocate a single floating buffer to avoid potential 
deadlock when the exclusive buffer
           // is 0. See FLINK-24035 for more information.
           bufferPool.reserveSegments(1);
   
           // Next allocate the exclusive buffers per channel when the number 
of exclusive buffer
           // is larger than 0
   ```




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