Repository navigation
Conversation
Discovery probes each databricks binary with a 10 s timeout and records a timed-out probe as unparseable. A cold first run (e.g. right after an upgrade) can take longer, so the launch failed with "Could not parse Databricks CLI version ... 'Databricks CLI v1.20.0'" even though the fallback read in the same call succeeded. Retry a timed-out probe once with a 60 s budget. Signed-off-by: Harry Yao <harry.yao@databricks.com> Co-authored-by: Isaac <no-reply@databricks.com>
…-version-cold-start Signed-off-by: Harry Yao <harry.yao@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.
Summary
ugdiscovers everydatabricksbinary onPATHby running<path> --versionwith a 10 s timeout. A timed-out probe is recorded as "version unknown". When it is the only CLI onPATH,ensure_databricks_cli_versionthen fails the launch with:The output shown is from the fallback read in the same call, which succeeded: the version parses fine, and only the first probe was slow. A cold first run, e.g. right after a CLI upgrade while the OS verifies the new binary, can exceed 10 s. This came up in unattended launches from a wrapper, where nobody retries the command.
_read_databricks_cli_versionnow retries a timed-out probe once with a 60 s budget before it gives up. A fast CLI is unaffected: the first probe still answers within 10 s. AnOSErrorstill returnsNoneat once.Test plan
tests/test_databricks.py:test_read_version_retries_a_slow_first_run(new): the first probe times out, the 60 s retry returnsDatabricks CLI v1.20.0, and the version is read.test_read_version_swallows_timeoutnow also asserts the budgets are[10, 60].uv run pytest tests/test_databricks.py: 416 passed.uv run ruff check src tests,uv run ruff format --check src tests,uv run ty check src/: clean.This pull request and its description were written by Isaac.