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



##########
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:
       Yes, you are right. Previously, ```bufferOrEevnt.getBuffer()``` was 
always ```null```. And currently, it should be never null. So we do not need to 
support null buffer now.




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