fix: ZstdInputStream decompression failure when underlying stream returns 0 then -1 at frame boundary#372
Merged
luben merged 1 commit intoluben:masterfrom Jan 22, 2026
Conversation
…urns 0 then -1 When the underlying InputStream returned 0 bytes (no data available) followed by -1 (EOF) at a frame boundary, decompression would fail with "Truncated source" error because frameFinished remained false. Fix: only set frameFinished = false when srcSize > 0, and continue the loop when srcSize == 0 to retry reading.
Owner
|
Thanks for catching that bug! LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #372 +/- ##
============================================
+ Coverage 60.01% 60.81% +0.79%
- Complexity 308 334 +26
============================================
Files 26 27 +1
Lines 1473 1623 +150
Branches 170 192 +22
============================================
+ Hits 884 987 +103
- Misses 434 465 +31
- Partials 155 171 +16 🚀 New features to boost your workflow:
|
dongjoon-hyun
added a commit
to apache/spark
that referenced
this pull request
Feb 10, 2026
### What changes were proposed in this pull request? This PR aims to upgrade `zstd-jni` to 1.5.7-7. ### Why are the changes needed? To use the latest bug fixes: - https://github.com/luben/zstd-jni/releases/tag/v1.5.7-7 - luben/zstd-jni#372 - luben/zstd-jni#374 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: `Gemini 3 Pro (High)` on `Antigravity` Closes #54233 from dongjoon-hyun/SPARK-55456. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
rpnkv
pushed a commit
to rpnkv/spark
that referenced
this pull request
Feb 18, 2026
### What changes were proposed in this pull request? This PR aims to upgrade `zstd-jni` to 1.5.7-7. ### Why are the changes needed? To use the latest bug fixes: - https://github.com/luben/zstd-jni/releases/tag/v1.5.7-7 - luben/zstd-jni#372 - luben/zstd-jni#374 ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: `Gemini 3 Pro (High)` on `Antigravity` Closes apache#54233 from dongjoon-hyun/SPARK-55456. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
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.
Summary
frameFinishedto remainfalseeven when a frame was complete, leading to "Truncated source" errorframeFinished = falsewhen actually reading data (srcSize > 0), and skip when srcSize == 0Test plan