Repository navigation
Handle short reads from InputStream - #1061
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1061 +/- ##
===========================================
+ Coverage 66.47% 66.49% +0.02%
===========================================
Files 773 773
Lines 55802 55838 +36
Branches 8948 8955 +7
===========================================
+ Hits 37092 37131 +39
+ Misses 17053 17051 -2
+ Partials 1657 1656 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JackieTien97
approved these changes
Nov 3, 2026
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.
Problem
ReadWriteIOUtilsassumed that a singleInputStream.read()call would fill the requested buffer. TheInputStreamcontract permits partial reads, so valid input could fail withIntend to read N bytes but M are actually returned.This was exposed when a ConfigNode snapshot schema was read through a buffered stream: a schema larger than 8 KB crossed a buffer boundary and produced
Intend to read 4 bytes but 3 are actually returned.Change
EOFException.readAsPossible(TsFileInput, long, ByteBuffer)that silently consumed data.BytesUtils.safeReadInputStreamToBytesfail on truncated input instead of returning zero-filled data.Validation
Regression tests cover fragmented streams that return zero bytes once and then short reads. Tests and compilation were not run locally, per task constraints.