Repository navigation
feat(http): negotiate HTTP/2 for direct HTTPS connections - #483
aakash-saravanan-db wants to merge 13 commits into
Conversation
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 High · 2 Low · 1 Nit
Looks good, with 1 low concern. HTTP/2 wiring, the proxy downgrade and the telemetry key isolation all look correct, and the TLS-level tests check the negotiated protocol from start to finish. One gap remains: the PyO3 binding has no unit test for its new option.
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 — The pyo3
enable_http2override is applied inline inSession::new, outsidebuild_http_config, so the file's unit tests can't cover the None, True and False cases. Move the override into the helper and add a unit test. (Found by Claude Opus 5.5 · confirmed by the judge)
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 Low
Looks good, with one low concern. HTTP/2 is wired consistently through the Session, the C ABI, PyO3, napi and ADBC; the proxy fallback and telemetry keying are coherent; and the tests cover negotiation, fallback and proxies in child processes.
This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge — see the findings below.
🔀 1 finding considered and dismissed by the judge
- 🟡 Medium
src/client/http2_tests.rs:223— The negotiation test only exercises a local mock server, so it cannot establish that a warehouse accepts HTTP/2 for real SQL and result downloads or that the op
Judge's evidence:assert_eq!(response.version(), expected);
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 High · 1 Medium · 1 Low
Mostly sound. I have one medium concern: with HTTP/2 on by default, CloudFetch throughput may drop. Opt-out wiring across the Rust config, C ABI, PyO3, napi and ADBC is consistent, and the proxy and telemetry-key handling is well covered by tests.
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
- 🟠 High — Sessions with HTTP/2 disabled and sessions forced to HTTP/1.1 by a proxy share this key, so telemetry can use the first session's credentials and bypass the second session's proxy. Include transport and authentication identity in the cache key, or avoid sharing exporters across sessions. (Found by GPT-6.1 Terra · the judge couldn't confirm it)
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: 2 low concerns. The proxy-forced HTTP/1.1 rule, telemetry keys that include the protocol policy, and the wiring through C ABI, PyO3, napi and ADBC look correct and are well tested at the wire level.
This overview is Claude Opus 5.5's initial take; some of its points were set aside by the cross-check judge — see the findings below.
Other findings
- ⚪ Nit — If a client drops a connection mid-handshake,
acceptor.accept(socket).await.unwrap()panics inside the connection task.result.unwrap()injoin_nextthen re-raises that panic and kills the whole server task, so laterassert_versioncalls fail with a 5s timeout that hides the real cause. Log and skip failed accepts instead of unwrapping, so one aborted connection can't make the tests flaky. (Found by Claude Opus 5.5 · the judge couldn't confirm it)
🔀 2 findings considered and dismissed by the judge
- 🔵 Low
napi/src/database.rs:392— The new napi option isenableHttp2and the PyO3 kwarg isenable_http2, but the Rust field, the C ABI and ADBC all usehttp2_enabled, and the neighbouring
Judge's evidence:pub enable_geo_spatial_support: Option<bool>, - 🟡 Medium
src/config.rs:842— The new default transport has no repeatable live-warehouse regression comparing HTTP/2 negotiation with the opt-out across query execution and result downloads;
Judge's evidence:http2_enabled: true,
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: 3 Medium
Looks good, with 1 medium concern about HTTP/2 flow control for parallel result downloads. The opt-out reaches the Rust, C ABI, PyO3, napi and ADBC surfaces consistently, and proxy fallback and ALPN negotiation have tests under both TLS backends.
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
- 🟡 Medium — The protocol tests construct
DatabricksHttpClientdirectly, so they cannot catch a regression that drops the session's opt-out or fails to apply it to authentication and result downloads. Add a session-level transport test covering default and disabled negotiation through those request paths. (Found by GPT-6.1 Terra · the judge couldn't confirm it)
| .user_agent(&config.user_agent) | ||
| .redirect(redirect); | ||
|
|
||
| if !http2_enabled { |
There was a problem hiding this comment.
🟡 Medium — With HTTP/2 negotiated, parallel CloudFetch downloads to the same storage host multiplex over one TCP connection using hyper's default fixed stream/connection windows (no adaptive window), so pool_max_idle_per_host no longer spreads load and large-result throughput can regress at high RTT. Enable http2_adaptive_window(true) (or explicit window sizes) when HTTP/2 is on, and add a large-result benchmark comparing it with HTTP/1.1 before shipping the default.
🔀 Found by Claude Opus 5.5 · the judge couldn't confirm it
There was a problem hiding this comment.
The existing measurements cover S3 over HTTP/1.1 and do not establish GCS/HTTP/2 throughput. This remains a merge prerequisite: run five default/opt-out pairs on GCP, verify actual GCS response protocols and complete-result checksums, and report the samples and medians here. No GCS performance conclusion is claimed from the S3 results.
There was a problem hiding this comment.
Still open at d26ea07: no http2_adaptive_window or window sizes set (src/client/http.rs:551), and no GCS HTTP/2 benchmark results posted yet.
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: 2 Low
Looks good, with 1 low concern. The opt-out reaches every binding, the C ABI and ADBC, and TLS tests cover negotiation, HTTP/1.1 fallback and HTTPS CONNECT.
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: 2 Medium · 1 Low
Looks good overall, with 1 medium and 2 low concerns. The opt-out reaches every binding and the C ABI, and the proxy fallback is tested. The remaining concerns are HTTP/2 transport tuning (flow-control windows, keep-alive) and proxy detection on Windows.
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 Medium · 1 Low
Looks good, with 2 low concerns. The opt-out reaches every session-created client (the remaining DatabricksHttpClient::new callers are test-only), and the bindings, C ABI and ADBC are wired consistently.
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: 2 Low
Looks good, with 2 low concerns. The opt-out reaches the Rust, C ABI, PyO3, napi and ADBC surfaces, and there are negotiation, fallback and proxy tests. The h2 bump to 0.4.20 justifies removing the advisory ignores.
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: 2 Low
Mostly solid; 2 low concerns. The opt-out reaches every runtime client construction: the remaining DatabricksHttpClient::new callers are test-only. Bindings, the C ABI and ADBC are wired consistently and each has a test.
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
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: 2 Low
Mostly good, with 1 medium and 1 low concern. The protocol option reaches all four bindings and the tests cover negotiation, fallback, opt-out and CONNECT. The proxy-forces-HTTP/1.1 check doesn't account for platform system proxies.
| } | ||
| } | ||
|
|
||
| fn resolve_http2( |
There was a problem hiding this comment.
🔵 Low — resolve_http2 only checks the explicit proxy URL and six env vars. reqwest 0.12 also reads the Windows registry system proxy, so HTTP/2 can stay on behind a proxy, which the guard and docs say is forced to HTTP/1.1. Detect the platform proxy, or call .no_proxy() unless a proxy is set explicitly, and document the behavior.
🔀 Found by Claude Opus 5.5 · confirmed by the judge
|
|
||
| #[tokio::test] | ||
| async fn https_negotiates_http2_with_http1_fallback_and_opt_out() { | ||
| assert!( |
There was a problem hiding this comment.
🔵 Low — The direct-negotiation tests assert that no proxy env vars are set, so cargo test fails on any machine or CI with HTTP(S)_PROXY or ALL_PROXY exported. Skip the tests when a proxy is set, or run them in a child process with the proxy vars cleared.
🔀 Found by both reviewers · confirmed by the judge
vuanhphung
left a comment
There was a problem hiding this comment.
High level question: Why not default this to false for now and thoroughly benchmark separately?
| http2_enabled: bool, | ||
| redirect: reqwest::redirect::Policy, | ||
| ) -> Result<Client> { | ||
| let mut builder = Client::builder() |
There was a problem hiding this comment.
hyper caps HTTP/2 response headers at 16 KiB by default, against roughly 408 KiB for HTTP/1.1. A 20 KiB Set-Cookie fails over h2 with "unspecific protocol error". Worth setting http2_max_header_list_size for parity?
| # module load time and segfaults the process before any Rust code runs. | ||
| # `rustls` is pure Rust + ring and avoids the conflict entirely. | ||
| reqwest = { version = "0.12", default-features = false, features = ["json", "gzip", "stream"] } | ||
| reqwest = { version = "0.12", default-features = false, features = ["json", "gzip", "stream", "http2"] } |
There was a problem hiding this comment.
hyper accepts h2 0.4.14, so a consumer lockfile on 0.4.15 keeps RUSTSEC-2026-0258 after this lands, and this PR puts h2 on the default path. Could we add an h2 minimum (e.g. 0.4.20) to [dependencies], like the TLS minimums below?
Feature or gap
Negotiate HTTP/2 for session-owned HTTPS requests, with HTTP/1.1 fallback and an opt-out.
What this PR addresses
Apply the protocol policy to authentication, discovery, SQL, feature flags and result downloads. Rust, C ABI, Python/Node bindings and Rust ADBC expose the option; an explicit or environment proxy forces HTTP/1.1 client-wide, including bypassed destinations. Telemetry retains its per-host cache and may reuse an earlier session's HTTP settings. Public HTTP-client configuration fields and constructor signatures remain source-compatible.
Dependencies
Enables reqwest HTTP/2 and native-TLS ALPN, including the h2/fnv runtime dependencies, without changing reqwest's version. All four native build lockfiles resolve h2 0.4.20; the obsolete RUSTSEC-2026-0258 exemptions are removed. Consuming releases must include matching native artifacts and source pins.
Tests and validation
The C smoke test calls the exported HTTP/2 setter. Tests cover negotiation, fallback, Session-to-client opt-out wiring, redirect discovery, HTTPS CONNECT and proxy-policy resolution under both TLS backends. Request attempts are logged before sending, with sanitized URLs; response records include host, protocol and status.
GCS HTTP/2 large-result performance remains a merge prerequisite. Existing AWS measurements exercise S3 over HTTP/1.1 and do not validate GCS throughput. Current-head CI and compatible release artifacts remain required.
This pull request and its description were written by Isaac.