Repository navigation
Close dead HTTP/2 connections in the bundle workspace client - #7723
Merged
Merged
Conversation
The SDK's default transport uses HTTP/2 without health-check pings. When a connection dies without a FIN or RST, every request to the host keeps going out over it, including the retries added in #7521, until the OS gives up on TCP (~15 min on Linux). Give the bundle workspace client a transport with HTTP2Config.SendPingTimeout=30s and PingTimeout=15s so the dead connection is closed, and retry "http2: client connection lost" on idempotent calls. Co-authored-by: Isaac <no-reply@databricks.com>
cloud: TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=pipeline_allow_duplicate_names.yml.tmpl TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=job.yml.tmpl TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=pipeline_allow_duplicate_names.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: 8a92a8c
Top 3 slowest tests (at least 2 minutes):
|
- IsTransient (not only IsTransientRead) retries "http2: client connection lost": the health check now ends a request on a dead connection before the inactivity timeout, which IsTransient already retries. - Set the transport unconditionally; the nil guard could never be false. - Test proxy closes its connections; the health-check test tolerates the connection being closed before the request is sent; test that Workspace.Client picks the transport after insecure_skip_verify is resolved. cloud: TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=pipeline_allow_duplicate_names.yml.tmpl TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=job.yml.tmpl TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=pipeline_allow_duplicate_names.yml.tmpl Co-authored-by: Isaac <no-reply@databricks.com>
denik
marked this pull request as ready for review
November 17, 2026 13:47
denik
requested review from
Sankalp-Mittal,
andrewnester,
anton-107 and
renaudhartert-db
and removed request for
renaudhartert-db
November 17, 2026 13:47
Sankalp-Mittal
left a comment
Contributor
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Fable 5.2, cross-verified). Only points the reviewers agreed on are posted.
andrewnester
left a comment
Contributor
There was a problem hiding this comment.
No blocking findings from a full pass; I'll take a manual look at the remaining changes before approving.
- Note that workspace commands run in a bundle root use the transport too (cmd/root/auth.go builds their client from the bundle client's config). - Name experimental/ssh's newHTTP11Transport in the sync note. - The SDK attribute is skip_verify and has no env var. - Say why isConnectionLost matches by message. Co-authored-by: Isaac <no-reply@databricks.com>
Sankalp-Mittal
left a comment
Contributor
There was a problem hiding this comment.
[AI Generated] Follow-up review by review-factory (Claude Opus 5.5 + Claude Fable 5.2, cross-verified). Only points the reviewers agreed on are posted.
No new issues found.
idelafuente-oc
pushed a commit
to idelafuente-oc/cli
that referenced
this pull request
Nov 20, 2026
…icks#7748) ## Changes `acceptance/bundle/test.toml` gets a new `SuppressLines.warn_dms_transport` pattern. It moves a deployment history warning to the test log when the cause is a transport error: - `stream error: stream ID N; INTERNAL_ERROR; received from peer` - `unexpected EOF` - `context deadline exceeded` (the best-effort drain deadline) It covers the six best-effort warnings: `Failed to record/complete deployment history`, `Could not enable/record/read/delete deployment history`. `bundle/dms/suppress-transport-warnings` pins the pattern with lines it must suppress and lines it must keep. ## Why With `DMS=true`, the bundle suite records deployment history in every test and compares against the same goldens as the plain run. Recording is best effort, so the CLI only warns when a history call fails. When the server resets an HTTP/2 stream mid-response, that extra `Warn:` line fails an otherwise passing test. On 2026-11-17/18 this happened on every cloud, several tests per run. Judgment calls: - **Suppress only transport causes and the drain budget.** `context deadline exceeded` is the `OperationBuffer.Drain` budget, which a slow service also hits; it is best effort too. An error the service returns, such as a validation error or an empty-message 5xx, is still compared. A blanket filter on these warnings would have hidden real CLI bugs like the `operations.resource_key must have a known resource type` regression. The `dms_fault` and `dms` tests assert their injected warnings, which don't match (indented, or `Fault injected by test`). - **No CLI retry.** The reset arrives after the response headers, so the server may already have applied the write. The history writes aren't idempotent: CreateDeployment assigns the id server-side, CreateVersion conflicts on a repeat, and UpdateOperation sends the sequence id from the previous write. `libs/retry.IsTransientRead` only matches `*url.Error`, and these errors come from the SDK's body read (`response body: ...`). databricks#7723 adds HTTP/2 health-check pings for dead connections and does not change this. - **Not covered here:** the same stream reset on resource creates (secrets, model_provider_services) is a real deploy error and stays visible. So do the `[CLI] api get .../resources` failures in test scripts. The backend side is reported to the service owners. ## Tests - A throwaway Go test checked the pattern (as decoded from the TOML) against the failure lines below, plus the lines it must keep (empty-message errors, validation errors, fault-injection lines, resource create errors). - Local `TestAccept/bundle/{dms,dms_fault,resources/secrets,config-remote-sync}` pass. - AWS: `TestAccept/bundle/config-remote-sync/cli_defaults/DMS=true` passes. The commit message runs three affected tests on every cloud. ## Dashboard: | error | snippet | | -- | -- | | [error/3729](http://go/cli/dashboard/error/3729?main=1&pr=1&end=2026-11-18T06:00:00Z&last=3d) | `Warn: Failed to record deployment history: recording operation for resources.pipelines.[NAME]: response body: stream error: stream ID 51; INTERNAL_ERROR; received from peer` | | [error/3731](http://go/cli/dashboard/error/3731?main=1&pr=1&end=2026-11-18T06:00:00Z&last=3d) | `Warn: Failed to complete deployment history version: response body: stream error: stream ID 63; INTERNAL_ERROR; received from peer` | | [error/3732](http://go/cli/dashboard/error/3732?main=1&pr=1&end=2026-11-18T06:00:00Z&last=3d) | `Warn: Failed to record deployment history: recording operation for resources.postgres_roles.[NAME]: response body: stream error: stream ID 69; INTERNAL_ERROR; received from peer` | | [error/3733](http://go/cli/dashboard/error/3733?main=1&pr=1&end=2026-11-18T06:00:00Z&last=3d) | `Warn: Failed to complete deployment history version: response body: stream error: stream ID 9429; INTERNAL_ERROR; received from peer` | | [error/3013](http://go/cli/dashboard/error/3013?main=1&pr=1&end=2026-11-18T06:00:00Z&last=3d) | `Warn: Could not enable deployment history for this deploy: failed to create deployment: response body: stream error: stream ID 43; INTERNAL_ERROR; received from peer` | | [error/3031](http://go/cli/dashboard/error/3031?main=1&pr=1&end=2026-11-18T06:00:00Z&last=3d) | `Warn: Failed to record deployment history: context deadline exceeded` | | [error/3642](http://go/cli/dashboard/error/3642?main=1&pr=1&end=2026-11-18T06:00:00Z&last=3d) | `Warn: Failed to record deployment history: recording operation for resources.catalogs.[NAME]: Patch "[DATABRICKS_URL]/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/<N>/operations/catalogs.catalog1": unexpected EOF` | This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
andrewnester
approved these changes
Nov 23, 2026
deco-sdk-tagging Bot
added a commit
that referenced
this pull request
Nov 24, 2026
## Release v1.28.0 ### CLI * Retry transient errors in `fs` commands: `fs cp` to a UC Volume from another Volume or DBFS (files up to 8 MiB) on HTTP 503, DBFS uploads when the upload stream is lost, and stat, read and list on UC Volumes on HTTP 500. ([#7607](#7607), [#7763](#7763), [#7839](#7839)) * `databricks auth profiles --skip-validate` now omits the `Valid` column instead of reporting `NO` for every profile. ([#7638](#7638)) * Fix Ctrl-C taking about 10 seconds to stop `databricks aitools install`, `update` or `uninstall` while it runs a coding agent's CLI, and retry reading an agent's config on Windows while the agent rewrites it. ([#7832](#7832), [#7870](#7870)) * Automatic installation of Databricks AI tools no longer asks in containers or installs for the first time without a terminal, no longer runs as root in another user's home, keeps newer skills you installed, no longer hints to install what it is about to install, and on Linux and macOS stops the calling script on Ctrl-C. ([#7828](#7828), [#7834](#7834), [#7874](#7874), [#7888](#7888), [#7890](#7890), [#7901](#7901)) * Wait before retrying a failed automatic install of Databricks AI tools, starting at 5 minutes and doubling after each failure, so a skills source or coding agent CLI that stays broken no longer slows down each of the next commands. ([#7900](#7900)) * `databricks aitools install` now cancels the agent picker on Esc. ([#7721](#7721)) * `databricks aitools uninstall --skills` now fails when its value names no skill instead of removing every skill, and `aitools update` and `uninstall` no longer prompt when a coding agent runs them; with skills in both scopes they fail and ask for `--scope`. ([#7873](#7873)) * `databricks aitools install --skills-only` and `databricks aitools update` no longer mix skill files with the Databricks plugin: install skips agents that already have the plugin, and update no longer replaces skill files from a `--skills-only` install made with this release or later while the agent's CLI was on PATH. To keep skill files from an earlier `--skills-only` install, run `databricks aitools install --skills-only` again with the agent's CLI on PATH. ([#7831](#7831), [#7903](#7903)) * `apps init` no longer suggests installing skills to Codex and Copilot users who installed the Databricks plugin with `databricks aitools install`. ([#7830](#7830)) * Fix `databricks auth login` failing with `data passed to Set was too big` on macOS and Windows for OAuth tokens too large for one keyring item. ([#7845](#7845)) * Fix the token storage mode (`auth_storage`) being read from the file named by `DATABRICKS_CONFIG_FILE` instead of the config file the profile was loaded from. ([#7733](#7733)) * `databricks auth login` no longer waits for the browser that the default opener starts to close before it continues. ([#7551](#7551)) * Allow `databricks auth docker configure` when several profiles match one workspace; the chosen profile is recorded for the registry and shown by `databricks auth docker host`. ([#7383](#7383)) * Show the HTTP status, error code and endpoint when an API error has no message, instead of a bare `Error: `, and the HTTP status and path for Files API errors that used to show an empty `databricks-api error:`. ([#7800](#7800), [#7839](#7839)) * AI agents can now submit feedback without confirmation; `--yes`/`-y` is deprecated, and agents passing `--yes=false` now get an error. ([#7795](#7795)) * Log `/.well-known/databricks-config` fetch failures with a transient HTTP status (408, 429, or 5xx other than 501) at debug level instead of as a warning, like timeouts. ([#7912](#7912)) * Fix interactive list output sometimes dropping or reordering a page of rows. ([#7804](#7804), [#7914](#7914)) * Allow `databricks sandbox forward` to forward remote ports below 10000. The sandbox refuses a few reserved platform ports with an error that names the port. ([#7861](#7861)) * Breaking: `databricks sandbox ssh` now uses local SSH keys and works with sandboxes created through the SDK or API; it no longer accepts `--port` and needs Python 3 and `openssh-server` in the sandbox. Add `databricks sandbox ssh-setup` to configure native SSH and SCP. ([#7588](#7588), [#7589](#7589), [#7590](#7590)) * `databricks ssh connect` to serverless CPU compute now defaults to environment version 5, so the first connection after upgrading starts a new server; pass `--environment-version 4` to keep the old one. ([#7847](#7847)) * `databricks ssh connect` now downloads the SSH server binaries from PyPI when GitHub is unreachable, using `PIP_INDEX_URL` or `index-url` from the per-user pip config over HTTPS only, and checks SHA-256 digests. ([#7852](#7852)) ### AI Runtime * Breaking: `compute.pool_id` is no longer accepted in AIR workload YAML; use `compute.accelerator_pool_id`. ([#7698](#7698)) * `databricks air convert-to-dabs` handles an existing output directory better: it gives the right guidance when the directory already holds the workload's bundle, `--force` no longer replaces a different bundle or an alternate root file, re-converting removes stale sidecars, and git-pinned code outside the bundle gets an `--output-dir` suggestion. ([#7835](#7835), [#7853](#7853), [#7857](#7857), [#7866](#7866)) * `air list` and `air get` now find the AI Runtime task anywhere in a multi-task job; a job with several such tasks lists one row per task (so `run_id` is no longer unique in `air list -o json`), and both report `task_key` (`air get --task-key` selects one). `air list --all-status` now orders runs by submission time instead of by their latest attempt's start. ([#7632](#7632)) * Update fallback messages for pending AI Runtime runs when AIR does not report a status reason. ([#7899](#7899)) * `air run -o json` now reports config-validation errors as a JSON error envelope, with `UNAUTHENTICATED`, `INVALID_ARGS` or the new `PERMISSION_DENIED` code. ([#7864](#7864)) ### Bundles * Bundle commands no longer hang after a request timeout on a dead HTTP/2 connection. ([#7723](#7723)) * Fix a panic when the local Terraform state is removed after it is pulled and before it is migrated to the direct engine, for example by a concurrent `bundle deploy`. ([#7778](#7778)) * The direct deployment engine now uses a Lakebase or postgres catalog that a failed create request still created, instead of failing the deploy. ([#7801](#7801)) * `bundle deploy` and `bundle run` for apps now succeed when the app's compute is already active or starting, and deploy the app when the deployment triggered by start failed. ([#7709](#7709), [#7780](#7780)) * Add `thumbnail_path` to the `apps` resource, so `bundle deploy` sets, updates and deletes the thumbnail shown for the app in the Apps UI. ([#7728](#7728)) * Fix bundle commands failing on a notebook or file path with a colon in its first segment, such as the default workspace notebook name `New Notebook 2026-10-28 12:17:43.ipynb`. ([#7851](#7851)) * `bundle run` and `pipelines run` now retry transient errors from the pipeline events and update status reads while waiting for an update. ([#7800](#7800)) ### Dependency Updates * Bump dependencies with known vulnerabilities. ([#7904](#7904)) * Update the Go SDK to [v0.203.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.203.0). ([#7869](#7869), [#7906](#7906)) * Update `github.com/databricks/sdk-go/files` to [v0.9.0](https://github.com/databricks/sdk-go/blob/files/v0.9.0/files/CHANGELOG.md). ([#7889](#7889))
camielstee-db
pushed a commit
to camielstee-db/cli
that referenced
this pull request
Nov 24, 2026
…atabricks#7797) ## Changes Stacked on [databricks#7723](databricks#7723). - Move the health-checked HTTP/2 transport from `bundle/config` to a new `libs/httptransport` package and export it as `httptransport.HealthChecked(insecureSkipVerify)`. The code is unchanged; the `Workspace.Client` test stays in `bundle/config`. - Use it in the two test-harness clients that live for the whole test process: - `integration/internal/acc`: the shared workspace client of the integration tests (`wt.W`). - `libs/testproxy`: the recording proxy that acceptance tests put in front of the real workspace. ## Why These request timeouts are the same dead-connection failure that databricks#7723 fixes, in the test harness instead of the CLI. The SDK uses one process-wide default transport. Both clients above share it for every test in the `go test` process, so when the runner's connection to the workspace is silently dropped, every later request goes out over the same dead connection. Each one then times out after the 60s inactivity limit: - In the integration jobs, consecutive tests fail exactly one minute apart until the package runs out of tests. For example, 7 `integration/cmd/sync` tests from 02:29 to 02:35 in one Azure job, and 8 from 17:57 to 18:04 in one GCP Windows job. - In acceptance, the error arrives through the proxy as a 500 whose message is the proxy's own timeout (the `1m0s ... (500 UNKNOWN)` below). The CLI's own client has a 1m30s timeout. databricks#7723 covers only the CLI's bundle client, which issues the 1m30s variants. With this PR, a dead connection in the test harness is closed within 45s and the next request dials a new one. At most the in-flight request fails, not every test that follows. Judgment calls: - Moved the transport to `libs/` rather than importing `bundle/config` from the test harness. - Both clients set the transport before their config is resolved, so the SDK's token-refresh client uses it too. That client lives as long as the shared client does. With a transport set, the SDK ignores `skip_verify`; the integration tests and the proxy don't use it. - Left as is: the acceptance runner's `cloudWorkspace` client, which makes two calls once per process, and the CLI's non-bundle commands (production behavior; the SDK default transport is the long-term home for the health check). - No changelog entry: no user-visible change beyond databricks#7723. ## Tests - Moved unit tests pass (`libs/httptransport`, `bundle/config`), as does lint. New `libs/testproxy` tests check the proxy's transport. - Local acceptance: `bundle/resources/permissions/jobs/delete_one`, `selftest`, `bundle/deploy/files`. - Ran on AWS with `testme`: acceptance `bundle/resources/permissions/jobs/delete_one` (goes through the proxy) and integration `cmd/sync` `TestSyncEnsureRemotePathIsUsable*`. The last commit runs the acceptance test on AWS in CI. - The dead-connection condition itself cannot be triggered on demand in CI; `libs/httptransport` tests reproduce it with a blackhole proxy. ## Dashboard: | error | snippet | | -- | -- | | [error/1091](http://go/cli/dashboard/error/1091?main=1&pr=1&end=2026-11-19T09:00:00Z&last=7d) | `Received unexpected error: Get "[DATABRICKS_URL]/api/2.0/preview/scim/v2/Me": request timed out after 1m0s of inactivity` | | [error/2877](http://go/cli/dashboard/error/2877?main=1&pr=1&end=2026-11-19T09:00:00Z&last=7d) | `Received unexpected error: Post "[DATABRICKS_URL]/api/2.0/dbfs/mkdirs": request timed out after 1m0s of inactivity` | | [error/2950](http://go/cli/dashboard/error/2950?main=1&pr=1&end=2026-11-19T09:00:00Z&last=7d) | `Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/[PATH]": request timed out after 1m0s of inactivity (500 UNKNOWN)` | This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
HTTP2Config.SendPingTimeout = 30s,PingTimeout = 15s(bundle/config/transport.go). Otherwise it matches the SDK's default transport and carries overskip_verify. It is set inWorkspace.Clientafter the config is resolved.libs/retry.IsTransientalso retrieshttp2: client connection lost, the error a request gets when the health check closes its connection. It replaces the inactivity timeout for such requests, whichIsTransientalready retries (#7521), with the same uncertainty about whether the server applied the request. Non-overwrite writes such as the deploy-lock create are still not retried.Why
#7521 retries the SDK's "request timed out after 1m30s of inactivity". Since it landed, error/179 has failed twice on main (11-13 Azure linux, 11-17 GCP windows), and both runs show the same pattern:
import-file?overwrite=trueupload of the deploy retried twice and timed out every time, followed by the deploy-lockget-status;read tcp ...: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, which is the OS giving up on the TCP connection.So the workspace was fine; one process was stuck on a dead connection. The SDK transport has
ForceAttemptHTTP2and no health check, so all requests to the host share one TCP connection. A request that times out only resets its stream. Go then keeps using the connection while it has free stream slots (the ping sent with the reset has no timeout), so the retries go out over the same dead socket until the OS closes it (~15 min with Linux defaults). With the health check, a dead connection is closed ≤45s after it goes silent, the in-flight requests fail withhttp2: client connection lost, and the retry dials a new connection.Judgment calls:
cmd/root/auth.gobuilds their client from the bundle client's config. Other commands, and the token-refresh client the SDK builds while resolving the config, still use the SDK default transport. The long-term home is the SDK's default transport; this PR is the minimal fix for the CI failure.httpclient.makeDefaultTransport) field by field. It needs to be kept in sync on SDK upgrades, and the code comment says so.experimental/ssh/internal/client/releases.go(newHTTP11Transport) is another such copy, HTTP/1.1-only, and already lacksMaxIdleConnsPerHost; the comment names it, and sharing one base is left for a follow-up so this PR doesn't change the ssh client.Tests
TestTransportWithoutHealthCheckReusesDeadConnectionreproduces the failure: an HTTP/2 server behind a TCP proxy that silently drops an established connection; without the health check, a second request after a timeout goes out on the same dead connection.TestHealthCheckedTransportReplacesDeadConnection: with the health check, the request fails withhttp2: client connection lostand the next one dials a new connection.TestWorkspaceClientUsesHealthCheckedTransport:Workspace.Clientpicks the transport afterskip_verifyfrom the profile is resolved.IsTransientmessage. Local acceptanceTestAccept/bundleandTestAccept/authpass. On AWS,bundle/invariantno_driftanddelete_idempotentpass forjobandpipeline_allow_duplicate_names(DMS on and off). The last commit runs them on every cloud.Dashboard:
Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/[PATH]": request timed out after 1m30s of inactivityThe 11-17 failure (TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=job_with_task.yml.tmpl/READPLAN=1) isn't ingested by the dashboard yet; snippet from the job log:
This pull request and its description were written by Isaac.