wsry commented on a change in pull request #17037: URL: https://github.com/apache/flink/pull/17037#discussion_r698335837
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/buffer/LocalBufferPool.java ########## @@ -216,9 +220,10 @@ // Lock is only taken, because #checkAvailability asserts it. It's a small penalty for // thread safety. synchronized (this.availableMemorySegments) { - if (checkAvailability()) { - availabilityHelper.resetAvailable(); - } + // guarantee that we have one buffer on initialization Review comment: 1. Added more comments. 2. The argument check already guarantees that the numberOfRequiredMemorySegments must be greater than 0. 3. From, it seem that checkAvailability only request one buffer, not requesting all buffers at once (correct me if I am wrong). Do you mean we enhance this logic and request all buffers at once? -- 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