BewareMyPower commented on code in PR #24832:
URL: https://github.com/apache/pulsar/pull/24832#discussion_r2415734717


##########
pulsar-common/src/main/java/org/apache/pulsar/common/protocol/PulsarDecoder.java:
##########
@@ -483,6 +483,7 @@ public void channelRead(ChannelHandlerContext ctx, Object 
msg) throws Exception
             }
         } finally {
             buffer.release();
+            cmd.clear();

Review Comment:
   It would be better to add a comment here.
   
   `cmd.parseFrom` will be called each time in `channelRead`, calling `clear` 
seems to be unnecessary. However, `CommandGetTopicsOfNamespaceResponse` has a 
`topics` field, whose size could be large. Calling `clear()` mainly makes sense 
for this specific response.



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