leixm commented on code in PR #1313:
URL: 
https://github.com/apache/incubator-uniffle/pull/1313#discussion_r1393753206


##########
common/src/main/java/org/apache/uniffle/common/netty/TransportFrameDecoder.java:
##########
@@ -66,10 +67,10 @@ public void channelRead(ChannelHandlerContext ctx, Object 
data) {
       if (frame == null) {
         break;
       }
-      // todo: An exception may be thrown during the decoding process, causing 
frame.release() to
-      // fail to be called
       Message msg = Message.decode(curType, frame);
-      frame.release();
+      if (msg.body() == null) {

Review Comment:
   Usually in order to avoid a copy, the ByteBuf of TransportFrameDecoder will 
be directly referenced during decoding. At this time, the ByteBuf cannot be 
released, but it must be actively released when not in use.
   You can view GetLocalShuffleIndexResponse.decode `NettyManagedBuffer 
nettyManagedBuffer = new NettyManagedBuffer(byteBuf)`, which will be actively 
released when we are not using it. You can view this line of code in 
`ShuffleReadClientImpl#read`, `if (sdr != null) {
         sdr.release();
       }`



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to