You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Russole (via GitHub)" <gi...@apache.org> on 2026/09/23 13:49:18 UTC

[PR] MINOR: Document protocol message reader allocation limits [kafka]

Russole opened a new pull request, #23565:
URL: https://github.com/apache/kafka/pull/23565

   Add a 4.4.0 upgrade note for the message reader allocation limits added in ea1f10a713.
   Document the collection and tagged field limits, along with the capped initial collection allocation.


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Document protocol message reader allocation limits [kafka]

Posted by "Russole (via GitHub)" <gi...@apache.org>.
Russole commented on code in PR #23565:
URL: https://github.com/apache/kafka/pull/23565#discussion_r4110116517


##########
docs/getting-started/upgrade.md:
##########
@@ -33,6 +33,7 @@ type: docs
 ### Notable changes in 4.4.0
 
   * The `ClientQuotaCallback#updateClusterMetadata` method is deprecated and will be removed in Kafka 5.0. Custom implementations of `ClientQuotaCallback` no longer need to override this method, as a default no-op implementation is now provided. For further details, please refer to [KIP-1200](https://cwiki.apache.org/confluence/x/axBJFg).
+  * Generated protocol message readers now bound collection allocations when decoding messages. Collections with more than 1,000,000 elements and flexible-version tagged-field sections with more than 10,000 fields are rejected before allocation; larger valid collections are no longer preallocated beyond 1,000 elements. This prevents a peer from triggering excessive heap allocation through sender-declared collection sizes.

Review Comment:
   Thanks, I've updated the note to include ArrayOf and CompactArrayOf.



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Document protocol message reader allocation limits [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 merged PR #23565:
URL: https://github.com/apache/kafka/pull/23565


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Document protocol message reader allocation limits [kafka]

Posted by "Russole (via GitHub)" <gi...@apache.org>.
Russole commented on PR #23565:
URL: https://github.com/apache/kafka/pull/23565#issuecomment-5814844004

   @m1a2st, @chia7712, @mingyen066  When you have time, could you please help take a look at this PR? Thank you!


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Document protocol message reader allocation limits [kafka]

Posted by "chia7712 (via GitHub)" <gi...@apache.org>.
chia7712 commented on code in PR #23565:
URL: https://github.com/apache/kafka/pull/23565#discussion_r4104708455


##########
docs/getting-started/upgrade.md:
##########
@@ -33,6 +33,7 @@ type: docs
 ### Notable changes in 4.4.0
 
   * The `ClientQuotaCallback#updateClusterMetadata` method is deprecated and will be removed in Kafka 5.0. Custom implementations of `ClientQuotaCallback` no longer need to override this method, as a default no-op implementation is now provided. For further details, please refer to [KIP-1200](https://cwiki.apache.org/confluence/x/axBJFg).
+  * Generated protocol message readers now bound collection allocations when decoding messages. Collections with more than 1,000,000 elements and flexible-version tagged-field sections with more than 10,000 fields are rejected before allocation; larger valid collections are no longer preallocated beyond 1,000 elements. This prevents a peer from triggering excessive heap allocation through sender-declared collection sizes.

Review Comment:
   Could those docs reflect recent changes? see https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/protocol/types/CompactArrayOf.java#L87



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Document protocol message reader allocation limits [kafka]

Posted by "Russole (via GitHub)" <gi...@apache.org>.
Russole commented on PR #23565:
URL: https://github.com/apache/kafka/pull/23565#issuecomment-5848860430

   Thanks @chia7712 , @rahul05ranjan for the review.


-- 
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: jira-unsubscribe@kafka.apache.org

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