Repository navigation
Update zstd-jni to 1.5.7-25 and call setLongMax directly - #3721
Merged
Merged
Conversation
Motivation: apache#3710 looked up ZstdDecompressCtx.setLongMax with a MethodHandle because no zstd-jni release had it. zstd-jni 1.5.7-25 includes it, so the lookup can go. Modification: - Update zstd-jni from 1.5.7-24 to 1.5.7-25. - Call ZstdDecompressCtx.setLongMax directly instead of through a MethodHandle. zstd-jni is an optional dependency, so a NoSuchMethodError from an older version is still turned into an UnsupportedOperationException. - Drop the test branch for a zstd-jni without setLongMax, and update the docs to name 1.5.7-25 as the minimum version for withWindowLogMax. Result: The zstd decompression window limit works with the zstd-jni version Pekko depends on. Tests: - sbt "stream-tests/testOnly org.apache.pekko.stream.io.compression.ZstdSpec org.apache.pekko.stream.io.compression.CompressionWithoutZstdSpec" (42 passed) - sbt "++3.3.8 stream/compile" - scalafmt on the changed Scala files References: Refs apache#3674, apache#3710
pjfanning
added a commit
to pjfanning/incubator-pekko
that referenced
this pull request
Oct 28, 2026
…) to the 2.0.0 release notes
pjfanning
added a commit
to pjfanning/incubator-pekko
that referenced
this pull request
Oct 30, 2026
…) to the 2.0.0 release notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
#3710 looked up
ZstdDecompressCtx.setLongMaxwith aMethodHandle, because no zstd-jni release had it yet (luben/zstd-jni#431), and left a TODO to call it directly once one did. zstd-jni 1.5.7-25 includessetLongMax.Modification
ZstdDecompressCtx.setLongMaxdirectly inZstdDecompressorand remove theMethodHandlelookup and the TODO.NoSuchMethodError, which is caught and rethrown as the sameUnsupportedOperationExceptionas before. ALinkageErroris notNonFatal, so without this the decompression context would not be closed when materialization fails. The default path (no window limit) never callssetLongMaxand still works with older zstd-jni versions.ZstdSpec: drop the branch for a zstd-jni withoutsetLongMax, so the window limit test always checks that a 2^24-window frame is rejected at 23 and decodes at 24.withWindowLogMaxscaladoc and thezstdDecompresspage to name 1.5.7-25 as the minimum zstd-jni version.Result
The zstd decompression window limit works with the zstd-jni version Pekko depends on, without reflection.
The
zstd-jni 1.5.7-24line in the 2.0.0 release notes is not changed here, to avoid a conflict with #3675. I will update it there once this is merged.Tests
sbt "stream-tests/testOnly org.apache.pekko.stream.io.compression.ZstdSpec org.apache.pekko.stream.io.compression.CompressionWithoutZstdSpec": 42 passed, 1 pending (existing)sbt "++3.3.8 stream/compile"scalafmton the changed Scala files@InternalApicode and docs changedReferences
Refs #3674, #3710