pjfanning opened a new pull request, #3721: URL: https://github.com/apache/pekko/pull/3721
### Motivation #3710 looked up `ZstdDecompressCtx.setLongMax` with a `MethodHandle`, 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 includes `setLongMax`. ### Modification - Update zstd-jni from 1.5.7-24 to 1.5.7-25. - Call `ZstdDecompressCtx.setLongMax` directly in `ZstdDecompressor` and remove the `MethodHandle` lookup and the TODO. - zstd-jni is still an optional dependency that users add themselves, so an older version can be on the classpath. The direct call then throws `NoSuchMethodError`, which is caught and rethrown as the same `UnsupportedOperationException` as before. A `LinkageError` is not `NonFatal`, so without this the decompression context would not be closed when materialization fails. The default path (no window limit) never calls `setLongMax` and still works with older zstd-jni versions. - `ZstdSpec`: drop the branch for a zstd-jni without `setLongMax`, so the window limit test always checks that a 2^24-window frame is rejected at 23 and decodes at 24. - Update the `withWindowLogMax` scaladoc and the `zstdDecompress` page 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-24` line 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"` - `scalafmt` on the changed Scala files - MiMa not run: only `@InternalApi` code and docs changed ### References Refs #3674, #3710 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
