SNOW-3479780: unblock canceled Arrow chunk reads#1795
Merged
sfc-gh-boler merged 1 commit intoMay 13, 2026
Conversation
823c86a to
170585a
Compare
sfc-gh-dheyman
approved these changes
May 13, 2026
Collaborator
sfc-gh-dheyman
left a comment
There was a problem hiding this comment.
one comment, but overall LGTM
170585a to
1cf5b23
Compare
SNOW-3479780 / issue #1789 report that canceling an Arrow stream after the chunk response is already open can leave the read path stalled until the client timeout because nothing interrupts the live body read. In practice that also leaves the caller-facing read goroutine stuck and surfaces transport-specific close behavior instead of a clean `context.Canceled`. This change wraps opened Arrow chunk streams in a cancel-aware reader that interrupts the raw response body when `ctx.Done()` fires, normalizes interrupted terminal read errors to `ctx.Err()`, and still preserves true successful completion and EOF semantics, including the final `n > 0, io.EOF` case. The tests now cover stalled-read unblock, non-EOF close-error normalization, already-canceled `GetStream()` behavior, close-then-cancel watcher shutdown, and completed plain and gzip-backed streams. The default streaming model is unchanged, and Reset/retry integration stays out of scope.
1cf5b23 to
ec641ae
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
SNOW-3479780 / issue #1789 report that canceling an Arrow stream after the chunk response is already open can leave the read path stalled until the client timeout because nothing interrupts the live body read. In practice that also leaves the caller-facing read goroutine stuck and surfaces transport-specific close behavior instead of a clean
context.Canceled.This change wraps opened Arrow chunk streams in a cancel-aware reader that interrupts the raw response body when
ctx.Done()fires, normalizes interrupted terminal read errors toctx.Err(), and still preserves true successful completion and EOF semantics, including the finaln > 0, io.EOFcase. The tests now cover stalled-read unblock, non-EOF close-error normalization, already-canceledGetStream()behavior, close-then-cancel watcher shutdown, and completed plain and gzip-backed streams. The default streaming model is unchanged, and Reset/retry integration stays out of scope.Checklist