Skip to content

KAFKA-19839: Fix NoSuchFieldError for zstd compression in native image#22016

Open
sstremler wants to merge 1 commit intoapache:trunkfrom
sstremler:KAFKA-19839-add-missing-dstpos-field-to-zstdoutputstreamnofinalizer-jni-config
Open

KAFKA-19839: Fix NoSuchFieldError for zstd compression in native image#22016
sstremler wants to merge 1 commit intoapache:trunkfrom
sstremler:KAFKA-19839-add-missing-dstpos-field-to-zstdoutputstreamnofinalizer-jni-config

Conversation

@sstremler
Copy link
Copy Markdown
Contributor

This fix solves the NoSuchFieldError thrown by the native broker if the topic compression.type is zstd, but the producer sends the message uncompressed.

The fix adds the missing ZstdOutputStreamNoFinalizer class with its dstPos and srcPos fields to the JNI config, so when the native resetCStream method is called in ZstdOutputStreamNoFinalizer, GraalVM can resolve the fields at runtime instead of throwing NoSuchFieldError.

@github-actions github-actions bot added triage PRs from the community docker Official Docker image small Small PRs labels Apr 9, 2026
@sstremler
Copy link
Copy Markdown
Contributor Author

I created this app to reproduce the issue and test the change.

https://github.com/sstremler/kafka-zstd-reproducer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Official Docker image small Small PRs triage PRs from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant