fix(arrow): avoid retains on invalid chunk construction - #1078
Merged
zeroshade merged 1 commit intoAug 5, 2026
Conversation
fallintoplace
force-pushed
the
fix/chunked-construction-cleanup
branch
from
August 1, 2026 17:04
6524997 to
1f3d7bb
Compare
fallintoplace
force-pushed
the
fix/chunked-construction-cleanup
branch
from
August 1, 2026 17:12
1f3d7bb to
865e363
Compare
zeroshade
approved these changes
Aug 5, 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.
Rationale for this change
NewChunked validated and retained inputs in the same loop. If an early chunk matched the requested datatype but a later chunk did not, the function panicked after retaining the earlier chunk. Callers that recovered and released their own references could not free its buffers.
What changes are included in this PR?
Validate every non-nil chunk datatype before retaining any input. Invalid construction now leaves all caller-owned reference counts unchanged. Successful construction, nil-chunk handling, and the existing panic value are unchanged.
Are these changes tested?
Yes. The existing invalid-chunk test now places a valid chunk before the mismatched chunk. Its checked allocator therefore verifies rollback in addition to the existing exact ErrInvalid assertion.
Are there any user-facing changes?
No API changes. Recovering from invalid chunk construction no longer leaves earlier inputs retained.