Skip to content

fix: sync response header version to clamped request header#3223

Merged
dnwe merged 1 commit intoIBM:mainfrom
trapped:fix/sync-response-header-ver
Aug 3, 2025
Merged

fix: sync response header version to clamped request header#3223
dnwe merged 1 commit intoIBM:mainfrom
trapped:fix/sync-response-header-ver

Conversation

@trapped
Copy link
Copy Markdown
Contributor

@trapped trapped commented Jul 16, 2025

Smallish refactor changing the internal structure of responsePromise: instead of storing a (potentially stale) response header version, it now stores a pointer to the response's protocolBody (if any).

This allows sendInternal to easily update the response's Version after version negotiation. (request and response versions must match; header versions instead don't map 1-1, meaning we can't rely on the request's header version for decoding responses).

Fixes the issue from this comment.

Smallish refactor changing the internal structure of responsePromise:
instead of storing a (potentially stale) response header version, it now
stores a pointer to the response's protocolBody (if any).

This allows sendInternal to easily update the response's Version after
version negotiation. (request and response versions must match; header
versions instead don't map 1-1, meaning we can't rely on the request's
header version for decoding responses).

Signed-off-by: Giorgio Pellero <[email protected]>
@dnwe
Copy link
Copy Markdown
Collaborator

dnwe commented Jul 16, 2025

@trapped historically in the functional tests we pin the Sarama config version to match the remote Kafka version we are testing against, but it might be worth updating that here to just always set MaxVersion and UseApiVersions and that should shake out this sort of issue too (where Sarama supports a newer version than the remote)

@trapped trapped force-pushed the fix/sync-response-header-ver branch from e48a683 to 80eff2d Compare July 16, 2025 11:44
@trapped
Copy link
Copy Markdown
Contributor Author

trapped commented Jul 16, 2025

@dnwe thanks for the suggestion, that makes a lot of sense. I've just pushed a new commit with that change. Let's see if CI breaks.

@dnwe dnwe force-pushed the fix/sync-response-header-ver branch 3 times, most recently from 454b4e5 to 8f1f8de Compare August 2, 2025 08:18
@dnwe dnwe marked this pull request as ready for review August 3, 2025 16:40
@dnwe dnwe changed the title Store protocolBody ptr in responsePromise, sync header version fix: sync response header version to clamped request header Aug 3, 2025
@dnwe dnwe force-pushed the fix/sync-response-header-ver branch from 5532671 to 38ed256 Compare August 3, 2025 16:46
@dnwe
Copy link
Copy Markdown
Collaborator

dnwe commented Aug 3, 2025

Cool, that testing eventually worked with apiversions by default. I've taken those commits off again so we can merge this PR with the single focus and then I'll raise a separate PR to move to "enable apiversions by default" as a followup

@dnwe dnwe added the fix label Aug 3, 2025
@dnwe dnwe merged commit 38ed256 into IBM:main Aug 3, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants