Skip to content

Raise the databricks --version probe timeout to 30s - #1337

Closed
michaelp-db wants to merge 1 commit into
mainfrom
michael-piatek/databricks-cli-version-timeout
Closed

michaelp-db wants to merge 1 commit into
mainfrom
michael-piatek/databricks-cli-version-timeout

Conversation

@michaelp-db

Copy link
Copy Markdown
Collaborator

What did you change, and why?

Raised the databricks --version probe timeout from 10s to 30s (new constant _DATABRICKS_CLI_VERSION_TIMEOUT_SECONDS). Both _read_databricks_cli_version and the re-probe that ensure_databricks_cli_version runs for its error message now use it.

On a loaded arca machine, databricks --version through the dbexec wrapper can take longer than 10s. On arca, /usr/local/bin/databricks is a wrapper (exec /usr/local/bin/dbexec repo run databricks "$@"), not the raw binary, so every call pays dbexec overhead and contends with other dbexec tools that start at the same time.

Failure seen on arca on 2026-10-27, when isaac was launched from OpenUI:

ERROR Could not parse Databricks CLI version from `databricks --version` output: 'Databricks CLI v1.22.1'
Claude Code exited with code 1

The version string is valid: the parser regex handles it and the minimum is 1.0.0. What happened is that _read_databricks_cli_version returns None on TimeoutExpired, just as it does for unparseable output. ensure_databricks_cli_version then saw no parsed versions and ran --version again only to fill in the message. That second run succeeded, so the message shows a good version and blames parsing. The first probe had timed out.

Measured on arca (32 cores, load avg ~14 at the time):

  • A single call takes ~0.03s. _discover_databricks_clis(use_cache=False) took 0.07–1.1s when idle.
  • 16 concurrent databricks --version calls: min 0.10s, max 7.24s.
  • 24 concurrent calls, bimodal: 13 at 0.27–0.41s, 7 at ~1.3s, 4 at 7.49–7.76s.

So moderate concurrency alone reaches ~7.7s, before any other machine load. When several isaac/OpenUI sessions start at once on a loaded box, the probe goes past 10s. The normal case is unaffected because the timeout only matters when the CLI is slow.

Possible follow-up (not in this PR): when the probe times out, the error should say "timed out" instead of "could not parse".

How do you know it works?

A new unit test checks that _read_databricks_cli_version passes the new timeout. tests/test_databricks.py and tests/test_desktop_auth.py pass (509 tests), and just lint is clean.

This pull request and its description were written by Isaac.

On a loaded arca box the dbexec-wrapped CLI can take more than 10s to
answer `--version`. The timeout reads as an unparseable version, so the
launch fails with "Could not parse Databricks CLI version" even though the
re-probe for the error message returns a valid one.

Co-authored-by: Isaac <no-reply@databricks.com>
@michaelp-db

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #1252 / #1326, which handle the slow first probe with a retry. Root cause (dbexec blocking on Arca port allocation) is being fixed in dbexec per ES-2318563. Arca data point: 24 concurrent databricks --version calls through dbexec took up to 7.8s.

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