reswqa commented on code in PR #23957: URL: https://github.com/apache/flink/pull/23957#discussion_r1448417073
########## flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/hybrid/tiered/storage/TieredStorageMemoryManagerImpl.java: ########## @@ -385,7 +395,7 @@ private boolean shouldReclaimBuffersBeforeRequesting(long delayForNextCheckMs) { /** Note that this method may be called by the netty thread. */ private void recycleBuffer(Object owner, MemorySegment buffer) { - if (numRequestedBuffers.get() <= bufferPool.getNumBuffers()) { + if (!isReleased.get() && numRequestedBuffers.get() <= bufferPool.getNumBuffers()) { Review Comment: If downstream task thread pass this check, but not got to the next line yet. At the same time, the upstream thread run and complete the `release`. Is it safe enough here 🤔 -- 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