Repository navigation
fix: bound Thrift CloudFetch downloads with ClientTimeout - #587
Conversation
bcbc38d to
6c6f29d
Compare
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Low
Looks good, no findings. Download clients now get a bounded timeout regardless of option order, the existing error chain is kept, and the tests cover stalled headers and bodies on all three result APIs. Possible follow-up: a redirect Location whose query differs from the original link is not redacted by the string-replace path.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Low
Looks good, with one low concern. The timeout wiring (a capped copy of the default client, and the WithTransport client built after options are applied) is correct and well tested. Error redaction misses one narrow redirect case.
Bound each Thrift CloudFetch transfer attempt with the existing 900s ClientTimeout so stalled downloads cannot wait indefinitely. Preserve default-client settings and use the final WithTransport option for downloads. Omit the link's presigned query string from download errors. Addresses #475 (part 2) Signed-off-by: Vu Anh Phung <[email protected]> Co-authored-by: Isaac <[email protected]>
d13de1a to
b689358
Compare
aakash-saravanan-db
left a comment
There was a problem hiding this comment.
Approving the timeout fix. Please address the blocking inline comment about preserving pkg/errors.Cause compatibility before merging.
Signed-off-by: Vu Anh Phung <[email protected]>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Nit
Looks good, with no blocking concerns. Only CloudFetch reads cfg.HTTPClient; the Thrift RPC client builds on cfg.Transport, so the new 900s timeout can't affect long-poll RPCs. Redaction keeps the cause chain intact for errors.Is and pkg/errors.Cause, and the retry log and DriverError text only ever see the redacted error.
Other findings
- ⚪ Nit — The
WithTransportdoc comment doesn't say that CloudFetch downloads now go through this transport and are bounded byClientTimeout. That is a user-visible behavior change that only the CHANGELOG records. Add a sentence to the comment. (Found by Claude Opus 5.5 · confirmed by the judge)
Signed-off-by: Vu Anh Phung <[email protected]>
Thrift CloudFetch downloads could wait indefinitely for headers or body data. Apply the existing 900s
ClientTimeoutper whole-transfer attempt: cap a copy ofhttp.DefaultClient, preserving its transport pool, cookies, redirects and shorter timeout, and constructWithTransportclients after options. CloudFetch now uses the lastWithTransport, as Thrift already did. No new option or API; rebased onto v2.0.0.The bound includes continuously progressing transfers, not just inactivity; existing retries can extend total elapsed time beyond 900s. Omit the link's presigned query string from Thrift download errors/logs while retaining typed causes. Kernel v1.5.0 already redacts its own errors and is unchanged. Expiry/re-fetch and final expiry diagnostics remain in #586.
Verification: reduced regressions still fail on
origin/mainand pass here: default-client header/body stalls, a distinct stallingWithTransport, option order, default-client settings and error redaction. Unit (1,837 tests; ten envless credential skips), lint, build/vet, root race, five Arrow-package race runs and kernel-tagged build/targeted tests pass on Go1.27.4. All three affected live Thrift tests pass without skips (5.755s; 2M default-client rows and 300K WithTransport rows). Three generated-file gofmt exceptions match main.Download benchmark, 5MiB: no measurable timing change across reruns (both directions observed); about 1 KiB and 10–11 extra allocations per file. Live warehouse timings are shared-worker correctness measurements.
Cross-driver state
socketTimeout=900s, inactivity;DatabricksHttpClient.java:148@0ad7a49;DatabricksSQLException.download_timeout=60s, inactivity;cloudfetch/downloader.py:58@087b2bf;RequestError.ClientTimeout=900s, whole transfer per attempt;batchloader.go:62; deadline cause retained.retriesTimeout=15min, total file budget;CloudFetchResultHandler.ts:160@abedbbf;RetryError.session.rs:1134,client/http.rs:1024@1aa8d8a (v1.5.0);ErrorCode::Timeout.Follow the general request-setting model with Node/kernel-like whole-transfer semantics, retaining Go's per-attempt retry scope rather than changing its retry policy.
Adversarial review: converged with zero open highs; all scope reductions applied, bot approved, and duplicate pre-existing hardening threads resolved as out of scope.
Addresses #475 (part 2)
This pull request and its description were written by Isaac.