Repository navigation
Conversation
| // 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(); |
There was a problem hiding this comment.
This is not correct. The buffer in the payload buffer is actually [header + message] . So, if we do buffer.remaining() here, we'll get the wrong header size. It can be confirmed via unit tests, ex: RequestResponseTest#testSerializeWithHeader. Fix it by removing the cache setting here.
|
@divijvaidya @mimaison , please take a look. Thanks. |
|
Thanks for catching this Luke! Bad of me to assume that buffer will be header data only. Seems like we incrementally read the buffer.
After the revert, we can use this PR to add tests. |
|
@divijvaidya Yeah I missed that too! |
|
Making another PR to address the issue is a good option. Let's fix this issue together! :) |
|
I used a different approach to calculate the size in the PR #12917 @showuon @mimaison Please check the corresponding PR for details. |
|
Close this PR and fix in #12917 |
In #12890 , we have an improvement for the ObjectSerializationCache in request/response header, but the header size is not correct calculated. Fix it and add size check tests.
Committer Checklist (excluded from commit message)