wsry commented on a change in pull request #11877:
URL: https://github.com/apache/flink/pull/11877#discussion_r664999767



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/netty/CreditBasedPartitionRequestClientHandler.java
##########
@@ -340,7 +355,15 @@ private void decodeBufferOrEvent(
             RemoteInputChannel inputChannel, NettyMessage.BufferResponse 
bufferOrEvent)
             throws Throwable {
         if (bufferOrEvent.isBuffer() && bufferOrEvent.bufferSize == 0) {
-            inputChannel.onEmptyBuffer(bufferOrEvent.sequenceNumber, 
bufferOrEvent.backlog);
+            try {
+                inputChannel.onEmptyBuffer(bufferOrEvent.sequenceNumber, 
bufferOrEvent.backlog);
+            } finally {
+                // recycle the empty buffer directly
+                Buffer buffer = bufferOrEvent.getBuffer();
+                if (buffer != null) {
+                    buffer.recycleBuffer();

Review comment:
       I think I can keep this logic unchanged and release the buffer in decoder




-- 
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