Repository navigation
fix(cloudfetch): keep connection headers off presigned downloads - #481
vuanhphung wants to merge 2 commits into
Conversation
Preserve link-provided storage headers and custom headers on warehouse, telemetry, OAuth token and discovery requests. Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Vu Anh Phung <vu.phung@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Terra), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 Nit
Looks good, no findings. The CloudFetchDownload check is the only download path (chunk_downloader.rs:123). The feature-flag GET applies headers separately and is unchanged (feature_flags/mod.rs:340). Tests cover all request types and the real downloader.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Terra added findings it doesn't mention — see the findings below.
Other findings
- ⚪ Nit — This is a test-coverage gap, not a code defect. The new tests only cover first-attempt success. The retry loop rebuilds the request on every attempt, and the header filter runs inside that loop, so the behaviour is probably correct. Add a test with a retryable 5xx followed by 200 that checks both attempts omit connection headers and keep the link header. (Found by GPT-6.1 Terra · confirmed by the judge)
|
Verified the retry nit with a local wiremock 503→200 probe: both attempts omit the connection sentinel and send the link header exactly once. CI note: Security Scan flags This comment was generated with GitHub MCP. |
|
Closing per maintainer decision: custom headers on presigned CloudFetch downloads haven't caused failures, so the kernel keeps its current behavior. The driver-test CUSTOMHDR-002 case will no longer assert storage-request headers. |
Connection custom headers were replayed by the shared HTTP retry loop onto presigned CloudFetch storage GETs. Skip that configured-header map only for
CloudFetchDownload; retain server-provided link headers and existing header behavior onexecute/execute_without_auth(SEA, telemetry, M2M/OIDC) and feature-flag GETs. A callerUser-Agentremains client-wide, including downloads; direct U2M token/refresh and Azure tenant-discovery behavior is unchanged. Addresses the coverage-factorycf-hdrfinding (no numbered kernel issue supplied).Verified red/green with wiremock regressions covering all 12 request types and the real
ChunkDownloader::download, which preserves one link header exactly once and the client-wide User-Agent. Root workspace tests: 1,322 passed; native/rustls client suites: 149/145 passed; napi tests: 91 passed. Format checks (root/ADBC/napi/pyo3), root/napi clippy, root build, napi release build and loader drift check pass. Live Node SEACUSTOMHDR-001consumes 100,000 ordered rows plus metadata and checks every warehouse request class: 3/3 fail at pindac32e2bf, 3/3 pass with this fix. Coverage branch4db7e66d5intentionally expects the leak; a factory-only runtime overlay removes its expected-failure wrapper without editing the shared test checkout or weakening assertions.Fresh-process loopback benchmarks against main
596379d88, alternating build order with three runs each (3,000 fully consumed 4-KiB requests/run): warehouse median 814.911 → 767.140 ms, CloudFetch median 758.257 → 689.713 ms. There is no measurable change for the warehouse path: the differences are within run-to-run noise, not a claimed speedup. The CloudFetch difference is also too noisy to claim a gain; these measure local HTTP-client overhead, not warehouse throughput.Cross-driver state
http.header.*(none by default); storage uses link headers + driver UA,ArrowResultChunk.java:81@d5bdaa3http_headers=None; storage uses link headers + driver UA,cloudfetch/downloader.py:109@b8259e4customHeaders; storage uses link headers,CloudFetchResultHandler.ts:131@bd8cb80arrowbased/batchloader.go:456@d9008a9HttpConfig.custom_headersdefaults empty; storage now excludes that map while retaining link headersShared User-Agent defaults and configured
x-databricks-org-idstill reach storage; restricting those is explicitly outside this minimal fix. Downstream binding pin bumps follow after merge. This touches the same HTTP builder as perf PR #470; no refactor or API changes.Adversarial review: converged in round 1 with no open high findings; all five requested documentation/test follow-ups are addressed.
This pull request and its description were written by Isaac.