SNOW-3479780: unblock canceled chunk downloader reads#1796
Merged
sfc-gh-boler merged 1 commit intoMay 13, 2026
Merged
Conversation
sfc-gh-dheyman
approved these changes
May 13, 2026
1cf5b23 to
ec641ae
Compare
Base automatically changed from
boler/SNOW-3479780-gosnowflake-arrow-stream-cancel
to
master
May 13, 2026 15:00
SNOW-3479780 extends the issue #1789 cancellation fix to the `chunk_downloader.go` path used by `database/sql`. Once a chunk response has been opened, the downloader can block inside JSON or Arrow decode waiting on the live HTTP body, which also leaves `Rows.Next()` stuck until the client timeout because the waiting row reader does not see an error until the download goroutine returns. This change wraps the downloader response body in the same cancel-aware stream used by the Arrow stream loader so `ctx.Done()` actively closes the underlying body, unblocks the stalled read, and normalizes the resulting terminal transport error to `ctx.Err()`. Focused tests cover both the decode helper and the `next()` waiting path so canceled `database/sql` reads now unblock promptly without switching away from the default streaming model or pulling Reset/retry handling into scope.
f23488d to
c348b73
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 extends the issue #1789 cancellation fix to the
chunk_downloader.gopath used bydatabase/sql. Once a chunk response has been opened, the downloader can block inside JSON or Arrow decode waiting on the live HTTP body, which also leavesRows.Next()stuck until the client timeout because the waiting row reader does not see an error until the download goroutine returns.This change wraps the downloader response body in the same cancel-aware stream used by the Arrow stream loader so
ctx.Done()actively closes the underlying body, unblocks the stalled read, and normalizes the resulting terminal transport error toctx.Err(). Focused tests cover both the decode helper and thenext()waiting path so canceleddatabase/sqlreads now unblock promptly without switching away from the default streaming model or pulling Reset/retry handling into scope.Checklist