gaoyunhaii commented on a change in pull request #8925: [FLINK-12852][network] 
Fix the deadlock occured when requesting exclusive buffers
URL: https://github.com/apache/flink/pull/8925#discussion_r302356552
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/NetworkBufferPool.java
 ##########
 @@ -186,6 +203,22 @@ public void recycle(MemorySegment segment) {
                                if (segment != null) {
                                        segments.add(segment);
                                }
+
+                               if (segments.size() >= 
numberOfSegmentsToRequest) {
+                                       break;
+                               }
+
+                               if (!deadline.hasTimeLeft()) {
+                                       throw new 
IOException(String.format("Insufficient number of network buffers: " +
 
 Review comment:
   Very thanks for the comments, I preferred to the second method since the 
timeout should need a different exception message. I have extracted the 
construction and changed the exception message for requesting timeout.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to