zhijiangW commented on a change in pull request #9905: [FLINK-14396][network] 
Implement rudimentary non-blocking network output
URL: https://github.com/apache/flink/pull/9905#discussion_r335271670
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java
 ##########
 @@ -207,7 +210,14 @@ public Buffer requestBuffer() throws IOException {
 
        @Override
        public BufferBuilder requestBufferBuilderBlocking() throws IOException, 
InterruptedException {
-               return toBufferBuilder(requestMemorySegment(true));
+               final MemorySegment segment = requestMemorySegment(true);
+
+               synchronized (availableMemorySegments) {
 
 Review comment:
   I actually also concerned for this part while implementing, and I tried to 
do it inside `LocalBufferPool#requestMemorySegment(boolean isBlocking)` before, 
but it seems a bit trouble to refactor that process because there are many 
internal paths to return/exit. Let me think it through again.

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