You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/06/17 02:58:12 UTC

[GitHub] [rocketmq] shengminw commented on pull request #4469: [ISSUE#4468] Optimize broker buffer length initialization

shengminw commented on PR #4469:
URL: https://github.com/apache/rocketmq/pull/4469#issuecomment-1158436344

   > 
   
   
   
   > Hi,
   > 
   > Thx for your contribution in advance. But we could make a discuss if it is worth making this change.
   > 
   > The ByteBuffer used here was from Netty API, and it already had an implementation of autoscaling under it. Whenever the ByteBuf reaches the initialCapacity set by developers, it would start to autoscale by 4MB until maxCapacity (set by devs) or Integer.MAX_VALUE.
   > 
   > Of course, we do not want autoscaling it every time, but if the chance of exceeding the maxMessageBodySize is not that high, I don't see why we need to add another 64KB (from your changes) for ByteBuf.
   
   Yes, using bytebuf can achieve automatic expansion, so in the current scenario, no error will be reported. But what I consider is that mq should have its own detection of the encoding length of the message body, instead of relying on the self-expansion of bytebuf.
   
   As for why it is 64kb, I have replied in a previous comment.


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org