Repository navigation
fix: bound Thrift CloudFetch downloads with ClientTimeout - #587
vuanhphung wants to merge 1 commit into
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 <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
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.
| return strings.ReplaceAll(downloadErr.cause.Error(), downloadErr.rawQuery, "[REDACTED]") | ||
| } | ||
|
|
||
| func (downloadErr redactedCloudFetchError) Unwrap() error { |
There was a problem hiding this comment.
Blocking: please preserve github.com/pkg/errors.Cause compatibility before merging.
The new redactedCloudFetchError implements Unwrap() but not Cause(). pkg/errors.Cause follows only Cause(), so it now stops at this wrapper. I reproduced the same truncated-body download failure on the base and this PR: errors.Is(err, io.ErrUnexpectedEOF) is true on both, but pkgerrors.Cause(err) == io.ErrUnexpectedEOF changes from true on the base to false here. Applications using the latter to classify failures lose the underlying cause.
Please add Cause() error returning downloadErr.cause, alongside Unwrap(), and a regression test. I verified that this restores compatibility while the existing redaction tests still pass.
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.