Skip to content

sandbox forward: stop sharing one HTTP/2 connection across requests - #7836

Open
jaecho-db wants to merge 2 commits into
mainfrom
jaecho-db/sandbox-forward-conn-pool
Open

jaecho-db wants to merge 2 commits into
mainfrom
jaecho-db/sandbox-forward-conn-pool

Conversation

@jaecho-db

Copy link
Copy Markdown
Contributor

Changes

databricks sandbox forward turns HTTP/2 off for its upstream transport, so each concurrent forwarded request gets its own connection. WebSocket upgrades still go over HTTP/1.1.

Why

The forward transport clones http.DefaultTransport. When the workspace negotiates HTTP/2, a warm connection pool sends all concurrent forwarded requests over one TCP connection, so parallel downloads share that connection's throughput. This matches CJ-82287, where four parallel 100 MiB downloads were no faster than one.

Cold starts already opened one connection per concurrent request, so the sharing only shows once a connection is warm, as it is after a first download.

Not measured yet: live throughput. Confirming the ~2x target needs a benchmark run against a sandbox.

Tests

  • go test ./cmd/sandbox: passes. TestForwardUsesSeparateUpstreamConnections fails on the old transport (the four requests used one upstream connection) and passes with this change (one warm plus three new). TestForwardHandlerRelaysUpgradeOverTLS covers WebSocket upgrade through the real transport against an HTTP/2-enabled TLS upstream.
  • go test ./acceptance -run TestAccept/cmd/sandbox/forward: passes.
  • ./task lint-q: Go reports 0 issues.

This pull request and its description were written by Isaac.

The forward transport cloned http.DefaultTransport, so when the workspace
negotiated HTTP/2 every concurrent forwarded request multiplexed onto one
TCP connection once a connection was warm. Parallel downloads then shared
that connection's throughput.

Turn HTTP/2 off for the forward transport. Each concurrent request gets its
own connection, and WebSocket upgrades keep working over HTTP/1.1.

Co-authored-by: Isaac <no-reply@databricks.com>
@jaecho-db
jaecho-db requested review from a team as code owners November 20, 2026 06:24
Co-authored-by: Isaac <no-reply@databricks.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant