rkhachatryan commented on code in PR #27624:
URL: https://github.com/apache/flink/pull/27624#discussion_r2817140599


##########
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/BufferManager.java:
##########
@@ -216,6 +221,10 @@ public void recycle(MemorySegment segment) {
                 if (inputChannel.isReleased()) {
                     
globalPool.recycleUnpooledMemorySegments(Collections.singletonList(segment));
                     return;
+                } else if (inputChannel.hasError()) {
+                    LOG.warn("Input channel has errors - recycling the 
buffer");
+                    
globalPool.recycleUnpooledMemorySegments(Collections.singletonList(segment));

Review Comment:
   Yes, at any given time each memory segment has only one owner, and recycling 
it twice would cause an error.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to