Repository navigation
Retry workspace requests after the SDK's inactivity timeout - #7521
Conversation
The SDK gives up on a request when the server sends nothing for HTTPTimeout
("request timed out after 1m30s of inactivity") and never retries it.
libs/retry already retries 5xx and 408 for overwrite writes, reads and
deletes; treat this timeout the same way. Print non-API retry reasons as
"retrying after <err>" so the warning says what happened and acceptance
tests suppress it like the other retry warnings.
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 2 tests: regression=2 unreleased=0 coverage=0 failing=0
TestAccept/bundle/upload/timeout/DMS=: branch ✅ | main (611f4e8) ❌ | latest (v1.26.0) ❌main (611f4e8): latest (v1.26.0): same output as main (611f4e8) TestAccept/bundle/upload/timeout/DMS=true: branch ✅ | main (611f4e8) ❌ | latest (v1.26.0) ❌main (611f4e8): latest (v1.26.0): same output as main (611f4e8) |
✅ Integration test reportCommit: e79c1d9
Top 8 slowest tests (at least 2 minutes):
|
| return false | ||
| } | ||
| msg := urlErr.Err.Error() | ||
| return strings.HasPrefix(msg, "request timed out after ") && strings.HasSuffix(msg, " of inactivity") |
There was a problem hiding this comment.
This matches the SDK's message because httpclient/api_client.go builds it with fmt.Errorf and exports no sentinel; can the comment say so, or should the SDK export one?
There was a problem hiding this comment.
Agreed: the comment should say so. The SDK (v0.197.0) builds this error with fmt.Errorf("request timed out after %s of inactivity", ...) in httpclient/api_client.go and exports no sentinel or type, so the CLI has to match the message. #7541 adds that note to the comment. An exported sentinel in the SDK would be the cleaner fix; I've left that for the SDK side.
Written by the cli-tests-fix AI agent (harness_auto).
…ks#7541) ## Changes Document in `libs/retry/retry.go` why `isInactivityTimeout` matches the SDK's error message: the SDK builds "request timed out after ... of inactivity" with `fmt.Errorf` in `httpclient/api_client.go` and exports no sentinel error or type for it. ## Why Follow-up to [databricks#7521](databricks#7521), addressing review feedback that merged before it was handled. An exported sentinel in the SDK would be the better long-term fix; until one exists, the message match follows the SDK's exact format string (prefix and suffix). ## Tests Comment-only change; `go test ./libs/retry` passes. This pull request and its description were written by Isaac. Co-authored-by: Isaac <no-reply@databricks.com>
## Changes `databricks fs cp/ls/cat/rm` now retry `Stat`, `Read`, `ReadDir` and `Delete` against DBFS and the Files API on transient errors, using the policy from `libs/retry` (5xx/408 the SDK did not retry, the SDK's "request timed out after ... of inactivity", `unexpected EOF`, `REFUSED_STREAM`; 2 retries, 15s apart). databricks#7521 added the inactivity-timeout retry, but only bundle code wraps its filers with `retry.Filer`; `cmd/fs` used the raw DBFS/Files clients, so a single stalled `GET /api/2.0/dbfs/get-status` failed the whole copy. Added `retry.FilerExceptWrites`, a variant of `retry.Filer` that passes `Write` through, because `fs cp` writes are not safe to retry the same way: - without `--overwrite`, a retried create may hit the file its own first attempt created, and `fs cp` would then report it as "skipped; already exists"; - with `--overwrite`, `retry.Filer` buffers a non-seekable source (e.g. a DBFS/Volumes read stream) in memory to replay it, and `fs cp` can copy multi-GB files. Question for reviewers: error/1213 below fails in `DbfsClient.Write` at `POST /api/2.0/dbfs/create`, before any data is read. Retrying just that call in overwrite mode would be safe and cheap; in non-overwrite mode a retry that gets RESOURCE_ALREADY_EXISTS could return the original timeout instead of "already exists". Worth doing in a follow-up? ## Why Flaky `integration/cmd/fs` tests on cloud. ## Dashboard | error | snippet | |---|---| | [error/2939](http://go/cli/dashboard/error/2939?main=1&pr=1&end=2026-11-12T13:45:00Z&last=7d) | `Get "[DATABRICKS_URL]/api/2.0/dbfs/get-status": request timed out after 1m0s of inactivity` | Tests: [integration/cmd/fs.TestFsCpDirToDirFileNotOverwritten/dbfs_to_uc-volumes](http://go/cli/dashboard/test/integration/cmd/fs.TestFsCpDirToDirFileNotOverwritten/dbfs_to_uc-volumes?main=1&pr=1&end=2026-11-12T13:45:00Z&last=7d), [integration/cmd/fs.TestFsCpFileToDir/dbfs_to_local](http://go/cli/dashboard/test/integration/cmd/fs.TestFsCpFileToDir/dbfs_to_local?main=1&pr=1&end=2026-11-12T13:45:00Z&last=7d) Not covered here (same family, different paths): - [error/1213](http://go/cli/dashboard/error/1213?main=1&pr=1&end=2026-11-12T13:45:00Z&last=7d) `dbfs open: Post "[DATABRICKS_URL]/api/2.0/dbfs/create": request timed out after 1m0s of inactivity`: a non-overwrite write, see the question above. - [error/3399](http://go/cli/dashboard/error/3399?main=1&pr=1&end=2026-11-12T13:45:00Z&last=7d) `Put "[DATABRICKS_URL]/api/2.0/fs/files/[PATH]": read tcp ...`: a test-setup write without overwrite, not a CLI call. - [error/2921](http://go/cli/dashboard/error/2921?main=1&pr=1&end=2026-11-12T13:45:00Z&last=7d) `Get "[DATABRICKS_URL]/api/2.0/workspace/get-status": unexpected EOF`: the generated `workspace get-status` command, which only goes through the SDK. ## Tests Unit tests for `retry.FilerExceptWrites`; new `acceptance/cmd/fs/retry-504` injects a 504 on dbfs list, get-status and delete and shows each retried; `cmd/fs` unit tests and local `TestAccept/cmd/fs` pass. This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
## Release v1.27.0 ### Notable Changes * `databricks aitools install`, `update` and `uninstall` now exit with code 1 when they do nothing they were asked to. `install` fails when it sets up nothing: no coding agent is detected, every agent is skipped or fails to install, or no skill in the release can be installed (also with `--path`). `update` fails when every update or check it attempts fails, and `uninstall` when every removal it attempts fails. Scripts that ran these commands as a best-effort step and relied on exit code 0 should handle the new exit code. ([#7481](#7481)) * Add `file:<path>` selectors to `pipelines run` and pipeline `bundle run`. `--refresh` and `--full-refresh` now use space-separated lists, such as `--refresh "orders payments"`, instead of comma-separated lists. Single names containing spaces now require backticks, e.g. ``--refresh 'table:`order details`'``. ([#7184](#7184)) * The Databricks CLI is now available on PyPI as `databricks`: run it with `uvx databricks`, or install it with `uv tool install databricks`, `pipx install databricks` or `pip install databricks`. The package contains only the prebuilt CLI binary. Uninstall the legacy `databricks-cli` package first, since both install a `databricks` command. ([#7704](#7704), [#7777](#7777)) ### CLI * Add `databricks sandbox fs` commands (`cp`, `ls`, `cat`, `mkdir`, `rm`) to transfer files between your local filesystem and sandboxes using `<sandbox-id>:/path`. ([#7372](#7372)) * `databricks fs` commands retry reads (stat, list, open) and deletes on DBFS and Volumes when the server returns a transient error or does not respond within the HTTP timeout. ([#7556](#7556)) * Retry UC Volumes file operations (`fs cp`, `fs ls`, `fs rm`, bundle uploads to Volumes) when the Files API returns HTTP 408, 429, 502, 503 or 504 (for example "AWS S3 is throttling requests"), or on a transient network error; this regressed in v1.10.0. ([#7559](#7559)) * Stop warning when the host metadata request (`/.well-known/databricks-config`) times out; the CLI already falls back to your config, and the message is still shown with `--debug`. ([#7752](#7752)) * Add `databricks aitools auto-install disable` and `enable` to turn off (or back on) the automatic installation of Databricks AI tools on CLI upgrades. A global-scope `databricks aitools uninstall` also turns it off. ([#7701](#7701)) * Stop printing the Databricks AI tooling install hint on `auth`, `configure`, `current-user me`, `version`, `help`, and shell-completion commands. ([#7452](#7452)) * When Codex, Cursor, GitHub Copilot CLI, OpenCode, Gemini CLI, Antigravity, Pi, Goose or Kiro run the CLI without Databricks skills installed for that agent, the CLI now prints a one-line hint to install them with `databricks aitools install --agents <agent> --scope global`, previously shown only to Claude Code. ([#7586](#7586)) * `databricks aitools install` now rejects an unknown `--agents` name before it shows the scope prompt, instead of after. ([#7469](#7469)) * `databricks aitools install` no longer asks "Proceed?" after the agent picker; the picker selection confirms the plan. The picker title now shows the install scope, its hint says Enter installs, `--skills-only` runs label plugin agents "skills" and pre-check every agent whose config dir exists, and the plan summary after it is reduced to the scope line. ([#7478](#7478)) * `databricks aitools install --output json` reports more specific `error_category` values: `SKILLS_FETCH_FAILED`, `RELEASE_LOOKUP_FAILED`, `RATE_LIMITED`, `MANIFEST_INVALID`, `STATE_INVALID` and `PLUGIN_CLI_TIMEOUT`. A coding agent CLI that does not answer in time is now reported as `timed out after <duration>`, followed by any stderr it wrote before it was stopped. ([#7475](#7475)) * `databricks aitools install` no longer prompts when a coding agent runs it, even in a pseudo-terminal; it uses the non-interactive defaults instead and prints a note saying so. ([#7477](#7477)) * `databricks aitools install` now prints the directory it installed skills into (for example `Installed 1 skill in ~/.databricks/aitools/skills.`), so agents can open the installed `SKILL.md` files without searching for them. ([#7668](#7668)) * `databricks aitools install` now ends a failed install with a step to recover, in the text output and in a new `recovery` field of `--output json`. ([#7480](#7480)) * `databricks aitools install` now installs plugins for the other coding agents even when installing skill files fails. ([#7479](#7479)) * `databricks aitools install` now installs skill files for a detected coding agent whose CLI is not on PATH (for example a Claude Code desktop or IDE install), unless it already has the plugin, says how to switch to the plugin later, and warns when the current project also has the plugin. `databricks aitools update` no longer tries to install the plugin for such an agent, and no longer writes skill files next to a plugin that such an agent already has. ([#7482](#7482)) * Fix `databricks aitools install` waiting a long time on an unreachable or slow workspace while it resolves authentication for telemetry; that wait is now limited to a few seconds. ([#7468](#7468)) * `databricks aitools install`, `update` and `list` now refuse a skills manifest that names a skill or file outside the skills directory, before writing any skill files. A skill whose name or file paths are not portable is skipped with a warning, and `update` keeps its installed copy. ([#7722](#7722)) * `databricks aitools install` and `databricks aitools update` refresh only the marketplace the Databricks plugin is listed in, so another unreachable marketplace no longer blocks them. When that refresh fails, both commands warn, install or update the plugin from the local copy of the marketplace, and record the plugin version as unknown. ([#7473](#7473)) * `databricks aitools install` and `databricks aitools update` now wait up to 20 seconds instead of 5 for a coding agent's CLI to answer the plugin capability check, so a slow first start is less likely to report the agent as unavailable. ([#7472](#7472)) * `databricks aitools install` no longer fails a plugin-only install when the lookup of the latest skills release on GitHub fails or is rate-limited. The plugin is installed and its version is recorded as unknown. ([#7474](#7474)) * `databricks aitools` commands now send usage telemetry, and the CLI records when it recommends installing Databricks AI tools. When the configured workspace is slow or unreachable, `aitools install`, `update` and `uninstall` can take up to about 6 seconds longer, and `list`, `version` and runs that stop early up to about 3 seconds. Set `DATABRICKS_CLI_DISABLE_TELEMETRY=1` to opt out. ([#7467](#7467), [#7469](#7469), [#7470](#7470)) * `databricks aitools install` and `databricks aitools update` now report a coding agent CLI shim (`.cmd` or `.bat`) on Windows that prints its plugin help and then exits with an error as `shim-exited-with-error`, with the command to run to see the error, instead of reporting the CLI as not on PATH. ([#7476](#7476)) * `apps init` no longer suggests installing skills when every detected coding agent already has the Databricks plugin. ([#7467](#7467)) * `databricks auth login` now gives up on the optional workspace lookup after about 5 seconds instead of retrying for about 5 minutes, and explains the fallback to the manual workspace ID prompt. ([#7522](#7522)) * Throttle Claude Code's native plugin install hint separately from the text hint: it prints at most once per 10 minutes per session, so the install dialog still comes up when a subagent, a hook, or a command outside a Claude Code subprocess runs the session's first `databricks` command. ([#7692](#7692)) * Print Claude Code's native plugin install hint alongside the text hint, so Claude Code offers a one-click install of the Databricks plugin. Claude Code now counts as having the tooling only when it loads it: skills only in `~/.databricks/aitools/skills` don't count, and a project- or local-scope plugin counts only when the CLI runs inside that project. `auth token`, `auth docker token` and CLI subprocesses no longer print install hints. ([#7585](#7585)) * Interactive prompts and pagers now work in Git for Windows' bash and other MSYS2 shells when they run under ConPTY (the default since Git for Windows 2.47) or directly in a Windows console. ([#7699](#7699)) * Add the `databricks feedback` command to send feedback about the CLI to Databricks. ([#7724](#7724)) * Fix shell completion in `databricks fs` commands for local paths typed with a leading `./` or repeated separators, which previously offered no suggestions. ([#7679](#7679)) * Fix a panic in `databricks labs` commands when a non-string SDK setting such as `DATABRICKS_DEBUG_HEADERS` or `DATABRICKS_RATE_LIMIT` is set in the environment. ([#7673](#7673)) * Fix a panic in `databricks labs install` for projects whose `labs.yml` has no `install` section. ([#7673](#7673)) * `NO_COLOR` no longer disables prompts, spinners or the list pager; they run without color. ([#7700](#7700)) * Add the Beta `databricks pipelines test` command, which runs the tests of a pipeline, and the `testing` property of pipelines in bundles. ([#7429](#7429)) * Add `databricks sandbox forward`, which serves an app running in a sandbox at a local URL. ([#7395](#7395)) * Bound the whole telemetry upload at exit, including config resolution and authentication, by its timeout, so a stalled auth or telemetry endpoint no longer keeps a command from exiting. ([#7467](#7467)) * `databricks version --check` now suggests `databricks aitools install` on stderr when a coding agent is detected without the Databricks plugin or skills. ([#7471](#7471)) ### AI Runtime * `air get -o json` now reports `PENDING` while the run waits for compute, matching `air list`, and includes the run's `status_message`. ([#7455](#7455)) * Wrap long failure reasons and log lines in the `air list` info and logs panes, keep the MLflow link (labeled with its retry) when a run's last retry failed before starting, and point `air logs` at earlier retries when the last one has no logs. ([#7456](#7456)) * `databricks air logs --node` now reports an out-of-range node index when it can determine the run's node count, instead of looking like a successful run with no logs. ([#7516](#7516)) * Add experiment, duration, accelerator, and dashboard metadata to `air list --output json`. For retried runs, `started_at` now reports the latest attempt, matching `air get`. ([#7568](#7568)) * `air list` shortens MLflow run names and unnamed-run IDs by keeping their end behind a leading `…`, and its columns no longer overflow on wide (for example CJK) text; `air get` shows an unnamed run's full MLflow run ID. ([#7582](#7582)) * Shrink the Experiment and User columns of the interactive `air list` table to fit the terminal width, keeping the end of a shortened experiment name. ([#7583](#7583)) * Show the experiment, accelerators and configuration in the `air list` info pane for runs where it showed `N/A`. ([#7587](#7587)) * Strip terminal control characters from the MLflow run, experiment and user names shown by `air list` and `air get`, so a run name cannot clear or retitle the terminal of whoever lists it. ([#7601](#7601)) * `air logs`, `air get`, and `air run --watch` no longer make an extra credential-check request before fetching the run, and `air get` reuses the configured workspace ID instead of looking it up. ([#7613](#7613)) * `air list` no longer waits on extra current-user requests before listing runs, which makes the default list about 150ms faster. ([#7615](#7615)) * `air list --all-status` requests larger index pages, so it makes far fewer round trips once the server supports `page_size`. ([#7616](#7616)) * Fit the interactive `air list` table to narrow terminals: when the Experiment and User columns are at their floors, shorten Started to `MM-DD HH:MM` and size the MLflow column to its labels, then hide Accelerators, User, MLflow and Progress in that order, naming the hidden columns in the hint line. ([#7629](#7629)) * `air get -o json` now includes `mlflow_run_id` and `mlflow_experiment_id`, so a run can be handed to MLflow-based steps without parsing `mlflow_url`. They identify the MLflow run `mlflow_url` links to, including one from an earlier retry that `mlflow_retry` names. ([#7636](#7636)) * `air get` and the `air list` info pane now show the environment of runs on the Databricks AI environment (`databricks_ai_v*`) instead of `N/A`. ([#7637](#7637)) * `air run` now rejects a `code_source.include_paths` path that selects no files instead of uploading a snapshot without it; glob patterns and pathspec magic are left to git. ([#7643](#7643)) * `air convert-to-dabs` now suggests the `--output-dir` that converts a working-tree workload whose `code_source.root_path` is outside the bundle directory, instead of suggesting `sync.paths`. ([#7644](#7644)) * `air run` now lists a `code_source.root_path` outside a git repository relative to `root_path`, so running from a subdirectory of `root_path` no longer uploads an empty or partial snapshot. ([#7646](#7646)) * `air list --all-status` now fills `--limit` past purged or inaccessible indexed runs. ([#7743](#7743)) * `air run` now warns about missing PyTorch when a pinned snapshot's `include_paths` selects a Python file. ([#7744](#7744)) * `air cancel JOB_RUN_ID` now rejects run IDs that are not AI Runtime runs instead of cancelling unrelated Jobs runs. In `-o json` output, the `failed[].error` text for a run that does not exist or that you cannot view now starts with `failed to get run <id>:` instead of the cancel API error. ([#7569](#7569)) * `air get -o json` now reports `mlflow_retry` when the MLflow link comes from an earlier retry because the run's last retry never reached MLflow. ([#7620](#7620)) * `databricks air run --help` now shows how to install the databricks-ai-runtime coding agent skill. ([#7652](#7652)) * `air run --watch -o json` now reports each lifecycle `STATUS` transition once and never reports a non-terminal state after the run has ended, including when logs are served from MLflow artifacts. ([#7621](#7621)) * `air convert-to-dabs` now explains the `--output-dir` workaround when `code_source.root_path` resolves to the bundle root, and notes when the generated job carries the default `max_retries`. ([#7579](#7579)) * `air run` now refuses to upload a `code_source` snapshot that selects no files (for example when `root_path` is git-ignored) and explains the cause, and `--dry-run` runs the snapshot file selection and reports the file count. ([#7570](#7570)) * Repeat the Jobs run link after live log streaming ends. ([#7571](#7571)) * `air get -o json` includes run details including flat `accelerator_type` and `num_accelerators`. Use `--include-config` to include stored config, which may contain plaintext `env_variables` and parameters; downloads over 1 MiB are omitted, and config-dependent `max_retries` is otherwise null. ([#7624](#7624)) * `air get` and the `air list` info pane no longer show `Max Retries 0` when the Jobs API leaves the task's retry limit out. For a run submitted with `air run`, the limit now comes from the run's uploaded config, shown as `3 (CLI default)` when the config doesn't set `max_retries`; it shows `N/A` when the limit can't be known (job runs, multi-container runs, legacy runs with no explicit value, or an unreadable config). ([#7623](#7623)) * Reorganize `databricks air` help: subcommands are grouped by task, `air run` has examples, and YAML fields are listed under headings, with pool fields marked optional and `command`, `compute.num_accelerators`, and `compute.accelerator_type` correctly marked required. ([#7512](#7512)) * `air run -h config` now lists the environment variables AI Runtime sets on every node (such as `MLFLOW_RUN_ID` and `CODE_SOURCE_PATH`), and `air logs --help` notes that `--download-to` cannot be combined with `--tail` or `--minutes`. ([#7655](#7655)) * Support full workspace accelerator types in `air list` filters while preserving family matching, and reject invalid filter values. ([#7515](#7515)) * `databricks air list --all-status` now warns when the AI Runtime run index is unavailable and it falls back to scanning Jobs runs. That fallback scan is capped at 250 runs, and a stuck index request fails after 15 seconds instead of retrying for minutes. `--all-status --filter user=<your email>` now uses the run index instead of scanning the workspace's full run history. ([#7619](#7619)) * Return structured JSON errors for invalid `air list --filter` values when `-o json` is used. ([#7612](#7612)) * `air list --all-status` no longer fails when a listed run has been purged. ([#7523](#7523)) * **Behavior change:** `databricks air logs` now prints the logs available now and exits, also for an active run, matching `kubectl logs`, `docker logs` and `databricks apps logs`. Pass `--follow` (`-f`) to stream new lines until the run completes; `--tail N --follow` prints the last N lines first. `databricks air run --watch` still submits and streams. ([#7658](#7658)) * `databricks air logs -o json` and `databricks air run --watch -o json` now emit a `WAITING` event, for example `{"type":"WAITING","message":"Waiting for accelerator compute capacity..."}`, when the reported waiting status changes. ([#7695](#7695)) * `databricks air logs` on a run that ended in the last two minutes now waits for the log index to settle before printing, instead of sometimes dropping lines that were indexed late. ([#7663](#7663)) * `air logs` and `air run --watch` now print the waiting status (for example `Waiting for accelerator compute capacity...`) as a line on stderr when stderr is not a terminal, instead of printing nothing until the run produces logs. ([#7657](#7657)) * Route AIR log links to the MLflow Logs page instead of the hidden artifact path. ([#7491](#7491)) * Invalid `compute.accelerator_type` errors and `air run -h config.compute` no longer list the CLI's built-in accelerator types, which could differ from the workspace's. ([#7520](#7520)) * `databricks air --help` now notes that GPU pools are not required to run workloads. ([#7581](#7581)) * `air run` now prints the job run URL with the `?o=<workspace-id>` suffix, matching `air get` and `air list`; `dashboard_url` in `air run -o json` and the `--watch` events gains it too. When `air list` cannot resolve the workspace ID, its links now omit `?o=` instead of ending in `?o=0`. ([#7573](#7573)) * `databricks air run` now reports an unknown workload YAML key by its field path, suggests the closest valid field, and points to `-h config` instead of naming an internal Go type. ([#7574](#7574)) * `air run` (including `--dry-run`) now warns before submitting when the `code_source` imports `torch` but PyTorch is not declared: the environment is the Standard environment (version 5 or later) with no `torch` dependency, so the run may fail after it waits for a GPU. ([#7656](#7656)) ### Bundles * Add `isolation_mode` to the `catalogs` resource, so a catalog can be deployed as `OPEN` or `ISOLATED`. ([#7463](#7463)) * `bundle validate` no longer warns when resource permissions and top-level or target permissions name the same principal. ([#7291](#7291)) * Retry bundle file uploads, reads and deletes when the server does not respond within the HTTP timeout ("request timed out after ... of inactivity"). ([#7521](#7521)) * Show how to recover when `bundle deploy` fails because an app's service principal does not exist or was deleted. ([#7533](#7533)) * Retry transient server errors when creating Lakebase (`postgres_*`) resources in the direct deployment engine. ([#7557](#7557)) * Fix `bundle plan` reporting the `spark_conf` and `custom_tags` the backend derives from `is_single_node: true` as drift on clusters. ([#7577](#7577)) * Stop planning a spurious update for Lakeflow Connect pipelines whose `ingestion_definition.data_staging_options` is filled in by the backend. ([#7603](#7603)) * Retry the root path check in `bundle destroy` on transient errors, so a dropped connection no longer fails the destroy. ([#7597](#7597)) * Use the Lakebase branch when its create request times out but the branch was created, instead of failing the deploy, in the direct deployment engine. ([#7602](#7602)) * Retry transient server errors when deleting resources in the direct deployment engine. ([#7708](#7708)) * Use the Lakebase project when its create request times out but the project was created, instead of failing the deploy with "already exists", in the direct deployment engine. ([#7747](#7747)) * Use the feature, model serving endpoint or dashboard that a create request created despite timing out, instead of failing the deploy, in the direct deployment engine. ([#7757](#7757)) * Use the Lakebase role when its create request fails with a transient error but the role was created, instead of failing the deploy, in the direct deployment engine. ([#7767](#7767)) * Use the MCP service, model service or model provider service that a create request created despite failing with a timeout, a 499 or a reset stream, instead of failing the deploy, in the direct deployment engine. Create recovery for features, serving endpoints and dashboards now also covers 499 and reset streams. ([#7782](#7782)) * Retry app updates and deletes in the direct deployment engine when they fail with 400 BAD_REQUEST because the app compute is `UPDATING`, after waiting for the compute to settle. ([#7606](#7606)) * Enable drift detection for `source_code_path` and `git_source` on apps. ([#6399](#6399)) * `bundle destroy` and `bundle deploy` no longer fail with "internal error, missing in state" when the state holds an empty-ID entry left by an interrupted recreate in an older CLI. ([#7676](#7676)) * Fix a feature whose `full_name` contains uppercase letters being recreated on every deploy. ([#7398](#7398)) * Fix `bundle deployment bind` (and `bundle generate --bind`) failing with `no such node "resources.internal_immutable_snapshots.immutable"` when `workspace.sync_mode` is `immutable`, as reported in [#7306](#7306). ([#7329](#7329)) * Retry creating the deployment lock (without `--force-lock`) when the request fails with a transient server error, times out ("request timed out after ... of inactivity") or loses its connection ("unexpected EOF"). ([#7594](#7594)) * Fix a materialization set member whose `feature_name` contains uppercase letters failing to deploy, or recreating the set on every deploy. ([#7398](#7398)) * Delete the old resource when its name follows a renamed schema. ([#7718](#7718)) * Fix `pipelines dry-run` starting a real run when given a job KEY, and a crash in its shell completion. ([#7672](#7672)) * Rename schemas in place; schemas and volumes follow a renamed catalog or schema. ([#7343](#7343)) * Fix a panic when validating or deploying jobs with local libraries and serverless job clusters. ([#7725](#7725)) * Fix `tgz` artifacts with `git` set producing an empty tarball or failing when the bundle is in a subdirectory of the git repository. ([#7674](#7674)) * Apply `presets.trigger_pause_status` and the development mode pause default to `triggers[]` entries on jobs. ([#7450](#7450)) ### Dependency Updates * Bump dependencies with known vulnerabilities. ([#7750](#7750)) * Update the Go SDK to [v0.198.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.198.0). ([#7530](#7530)) * Update the Go SDK to [v0.199.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.199.0). ([#7584](#7584)) * Update the Go SDK to [v0.200.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.200.0). ([#7653](#7653)) * Update the Go SDK to [v0.201.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.201.0). ([#7769](#7769))
## Changes
- `Locker.Lock` now retries the lock create (`import-file` with
`overwrite=false`) on the errors `libs/retry.IsTransientRead` covers:
5xx/408 that the SDK did not retry, the SDK's inactivity timeout
("request timed out after ... of inactivity"), and a connection cut
mid-response (`unexpected EOF`, `REFUSED_STREAM`). That check is named
for reads, but the lock create is safe to repeat for the reason below,
so it gets the same coverage. Forced locks overwrite and were already
retried by `retry.Filer` (on `retry.IsTransient`, which does not include
`unexpected EOF`), so their write is unchanged; they do get the
read-back below. Retrying overwrites on `unexpected EOF` is left to
[databricks#7611](databricks#7611).
- When the last attempt still fails with a transient error, forced or
not, `Lock` reads the lock back. If that attempt was applied and the
lock is ours, the lock is taken; otherwise it would stay behind, and
nobody would release it. If the lock belongs to someone else, the error
names the holder ("deploy lock acquired by ..."), except with
`--force-lock`, where that message would suggest the flag already in
use, so the write error is returned instead. If there is no lock, or the
read fails too, the original error is returned.
- `acceptance/bundle/telemetry/deploy-failed-engine-unknown` stubs every
`import-file` with a 500, which now hits the lock-create retries; it
sets `DATABRICKS_BUNDLE_RETRY_INTERVAL_MS` like the other tests that
inject 5xx, so it does not sleep 30s.
- New acceptance test `bundle/deploy/lock-retry` injects 504s on the
lock create and covers these cases:
- the create was applied before the 504: the retry hits 409 and the lock
turns out to be ours;
- the create was not applied: the retry creates the lock;
- every attempt returns a 504, but the first one was applied: the
read-back finds our lock;
- another deployer already holds the lock: the retry hits 409 and the
error names the holder.
- another deployer holds the lock and every attempt returns a 504: the
read-back names the holder;
- `--force-lock` and every overwrite attempt returns a 504 but is
applied: the read-back finds our lock.
- `--force-lock` over another deployer's lock, and every overwrite
attempt returns a 504 without being applied: the error is the 504.
- Unit tests in `libs/locker` for `unexpected EOF` on the lock create:
not applied, applied before the cut, retries exhausted but the last
attempt applied, and every attempt failing. `fault.py` cannot cut a
connection, so this case has no acceptance test.
- New acceptance test `bundle/deploy/lock-timeout`: every lock create
stalls past the inactivity timeout, so the CLI makes three attempts,
finds no lock when it reads it back, and fails with the timeout.
- Changelog entry in `.nextchanges/bundles/lock-retry.md`.
## Why
[databricks#7521](databricks#7521) made workspace
calls retry after the SDK's inactivity timeout, but it deliberately
skipped writes that do not overwrite, because a repeated create could
fail on the file its own earlier attempt created. The deploy lock create
is one of those writes, so the same server-side stalls still fail
deploys at "Failed to acquire deployment lock". The failures below all
ran on a main commit that already includes databricks#7521.
Retrying this create is safe because of how the lock works: the lock
file holds the locker's unique ID, and `Lock` always reads the file back
(`assertLockHeld`) after a create that fails with "already exists". So
whatever the earlier attempt did, the retry ends in a correct state:
- the earlier attempt created the file: the retry gets 409, the
read-back finds our ID, and we hold the lock;
- it did not: the retry creates the file;
- another deployer took the lock in between: the retry gets 409, the
read-back finds their ID, and we fail with the usual "deploy lock
acquired by ..." error.
A late-arriving earlier attempt cannot overwrite anything either, since
it also uses `overwrite=false`.
Known edge case, which the 504 retries elsewhere share: after an
inactivity timeout the server might still apply the stalled request
later. If it does so only after this deploy has released the lock, the
late create leaves a stale lock carrying our ID, and the next deploy
needs `--force-lock`. A stale lock from a single timed-out create was
already possible before this change.
Not done: an opt-in in `retry.Filer` for "fs.ErrExist after a retry is
fine". Only the lock needs it today, and it is safe there only because
of the read-back, so I kept the logic in `Lock`.
Judgment call: I used the same retry budget as databricks#7521 (`MaxRetries = 2`,
15s pause) so the lock acts like the other workspace writes. A
persistent write stall now takes about 5 minutes (3 × 90s + 2 × 15s)
before the deploy fails, which matches databricks#7521. If reads stall too, the
read-back after the last attempt is retried the same way through
`retry.Filer`, so the worst case is about 10 minutes. I kept the retried
read: a single read gives up on the first stall, which more often leaves
an applied lock of ours behind for nobody to release.
## Tests
- `acceptance/bundle/deploy/lock-retry` and `lock-timeout` (local
testserver, both DMS variants). Without the change, it fails with
`Error: Failed to acquire deployment lock: Fault injected by test.`
- Ran the local `bundle/deploy`, `bundle/destroy`, `bundle/upload`,
`bundle/state` and `pipelines` deploy/destroy acceptance tests. The only
failures are `bundle/state/state_present` and
`bundle/state/engine_default`, which fail on main too on my machine:
they record the user agent, which picks up an extra agent-environment
token there.
- I did not add a cloud test: the stalls are random and server-side, so
a cloud run cannot trigger them on demand. The timeout classification is
already unit-tested in `libs/retry`.
## Dashboard:
| error | snippet |
| -- | -- |
|
[error/124](http://go/cli/dashboard/error/124?main=1&pr=1&end=2026-11-13T09:00:00Z&last=2d)
| `Error: Failed to acquire deployment lock: Post
"[DATABRICKS_URL]/api/2.0/workspace-files/import-file/Workspace%2FUsers%2F[USERNAME]%2F.bundle%2F...%2Fdefault%2Fstate%2Fdeploy.lock?overwrite=false":
request timed out after 1m30s of inactivity` |
|
[error/125](http://go/cli/dashboard/error/125?main=1&pr=1&end=2026-11-15T10:00:00Z&last=7d)
| `Error: Failed to acquire deployment lock: Post
"[DATABRICKS_URL]/api/2.0/workspace-files/import-file/[PATH]":
unexpected EOF` |
On main in the last 2 days: 13 failures on 11 tests (AWS, Azure, GCP),
e.g.
[TestAccept/bundle/resources/postgres_branches/recreate/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/postgres_branches/recreate/DMS=?main=1&pr=1&end=2026-11-13T09:00:00Z&last=2d)
and
[TestAccept/bundle/resources/grants/feature_specs/DMS=](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/resources/grants/feature_specs/DMS=?main=1&pr=1&end=2026-11-13T09:00:00Z&last=2d).
This pull request and its description were written by Isaac.
---------
Co-authored-by: Isaac <no-reply@databricks.com>
…cks#7723) ## Changes - The bundle workspace client now uses its own HTTP/2 transport with health-check pings: `HTTP2Config.SendPingTimeout = 30s`, `PingTimeout = 15s` (`bundle/config/transport.go`). Otherwise it matches the SDK's default transport and carries over `skip_verify`. It is set in `Workspace.Client` after the config is resolved. - `libs/retry.IsTransient` also retries `http2: client connection lost`, the error a request gets when the health check closes its connection. It replaces the inactivity timeout for such requests, which `IsTransient` already retries ([databricks#7521](databricks#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 [databricks#7521](databricks#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: - every `import-file?overwrite=true` upload of the deploy retried twice and timed out every time, followed by the deploy-lock `get-status`; - the test hung for 631s (GCP windows) and 909s (Azure linux), while ~50 (resp. 45) other tests in the same job passed against the same workspace in that window; - on Windows the last attempt failed with `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 `ForceAttemptHTTP2` and 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 with `http2: client connection lost`, and the retry dials a new connection. Judgment calls: - Bundle workspace client only. That's where we see it and where the retries live. Workspace commands run in a bundle root use it too, because `cmd/root/auth.go` builds 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. - The transport copies the SDK's unexported default (`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 lacks `MaxIdleConnsPerHost`; the comment names it, and sharing one base is left for a follow-up so this PR doesn't change the ssh client. - 30s/15s are the values Kubernetes' client-go uses. The ping cost is one frame per 30s on a silent connection. ## Tests - `TestTransportWithoutHealthCheckReusesDeadConnection` reproduces 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 with `http2: client connection lost` and the next one dials a new connection. - `TestWorkspaceClientUsesHealthCheckedTransport`: `Workspace.Client` picks the transport after `skip_verify` from the profile is resolved. - Unit tests for the new `IsTransient` message. Local acceptance `TestAccept/bundle` and `TestAccept/auth` pass. On AWS, `bundle/invariant` `no_drift` and `delete_idempotent` pass for `job` and `pipeline_allow_duplicate_names` (DMS on and off). The last commit runs them on every cloud. ## Dashboard: | error | snippet | | -- | -- | | [error/179](http://go/cli/dashboard/error/179?main=1&pr=1&end=2026-11-17T12:00:00Z&last=7d) | `Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/[PATH]": request timed out after 1m30s of inactivity` | The 11-17 failure ([TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=job_with_task.yml.tmpl/READPLAN=1](http://go/cli/dashboard/test/acceptance.TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=job_with_task.yml.tmpl/READPLAN=1?main=1&pr=1&end=2026-11-17T12:00:00Z&last=7d)) isn't ingested by the dashboard yet; snippet from the job log: ``` Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/...dashboard.lvdash.json?overwrite=true": request timed out after 1m30s of inactivity Error: unlock called when lock is not held: Get "[DATABRICKS_URL]/api/2.0/workspace/get-status?path=...deploy.lock&return_export_info=true": read tcp [IP]->[IP]: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, ... ``` This pull request and its description were written by Isaac. --------- Co-authored-by: Isaac <no-reply@databricks.com>
Changes
libs/retry.IsTransientnow also returns true for the SDK's client-side inactivity timeout (*url.Errorwith "request timed out after ... of inactivity"). Callers already use it only for calls that are safe to repeat: overwrite writes and deletes throughretry.Filer, reads throughIsTransientRead, and the direct engine's update/delete/wait calls. Non-overwrite writes, such as the deploy lock create, are still not retried.retrying after <error>instead of a bareretrying, so the warning says what happened and acceptance tests suppress it like the other retry warnings (SuppressLines.warn_retry).acceptance/bundle/upload/timeoutnow records the two retries and the three upload attempts..nextchanges/bundles/7521.md.Why
When the workspace filesystem API sends nothing for
HTTPTimeout(90s for bundles), the SDK fails the request and never retries it. Its retry check only sees API errors and a short list of transport errors.libs/retry(#7129) fills the gaps for 5xx/408 but not for this timeout. This is the most common cloud-test failure: about 10k failures in 120 days onimport-filealone, mostly on burst days that hit AWS, Azure and GCP together. The same timeout also shows up onworkspace/get-status,workspace/importand GETworkspace-files.This is not a CLI regression. The stalls are server-side, and a test-level rerun sometimes succeeds (about 1 in 3 affected tests end up flaky rather than failed). A timeout carries the same uncertainty as a 504 (the server may or may not have applied the request), and we already retry 504s at these call sites.
Judgment call: a stalled attempt takes up to
HTTPTimeout(90s) before the retry. WithMaxRetries = 2and the 15s pause, a deploy that hits a persistent stall can now take about 5 minutes longer before it fails. That matches the intent inbundle/config/workspace.go("do utmost to complete" a deploy).Known edge cases: these call sites are already retried on 504, and a timeout now reaches them too. A UC rename that is applied but times out is re-sent with the old name and fails with a 404 (it fails safely, with no data loss). A lock release that is applied but times out could, in a narrow window, delete a lock that another deployer took in the meantime.
Overlap with #7518: #7518 widens the acceptance
SuppressLines.warn_retryfilter to also match the bareretryingwarning. This PR replaces that bare form withretrying after <error>at the source, so the current filter already matches it. The two PRs don't touch the same files, and either merge order works; #7518's wider filter stays as a safety net.Tests
libs/retryfor the timeout classification, including the wrapped and cancelled cases.acceptance/bundle/upload/timeoutshows the retries.Dashboard:
Error: Post "[DATABRICKS_URL]/api/2.0/workspace-files/import-file/[PATH]": request timed out after 1m30s of inactivityThis pull request and its description were written by Isaac.