reswqa commented on code in PR #22084: URL: https://github.com/apache/flink/pull/22084#discussion_r1125960686
########## flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java: ########## @@ -396,7 +396,7 @@ private MemorySegment requestMemorySegment(int targetChannel) { synchronized (availableMemorySegments) { checkDestroyed(); - if (availableMemorySegments.isEmpty()) { + if (availableMemorySegments.isEmpty() && isRequestedSizeReached()) { Review Comment: IIUC, poll buffer from empty `availableMemorySegments ` is not necessary as we guarded this field by lock. -- 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