pnowojski 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_r334970529
########## 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: Here we are acquiring the `availableMemorySegments` for the second time, can we try to avoid it somehow? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services