You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/11/29 06:05:44 UTC

[GitHub] [kafka] showuon commented on a diff in pull request #12916: MINOR: fix the header size calculation

showuon commented on code in PR #12916:
URL: https://github.com/apache/kafka/pull/12916#discussion_r1034332922


##########
clients/src/main/java/org/apache/kafka/common/requests/RequestHeader.java:
##########
@@ -118,7 +118,6 @@ public static RequestHeader parse(ByteBuffer buffer) {
             // We derive the header version from the request api version, so we read that first.
             // The request api version is part of `RequestHeaderData`, so we reset the buffer position after the read.
             int position = buffer.position();
-            int requestHeaderSize = buffer.remaining();

Review Comment:
   This is not correct. The buffer in the payload is actually [header + message]. So, if we do `buffer.remaining()` here, we'll get the wrong header size. Fix it by removing the cache setting here.



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