Bound databricks-cli login timeout to fix indefinite WSL hang#1921
Open
rugpanov wants to merge 1 commit into
Open
Bound databricks-cli login timeout to fix indefinite WSL hang#1921rugpanov wants to merge 1 commit into
rugpanov wants to merge 1 commit into
Conversation
*Why* With auth_type=databricks-cli, a stale/expired cached token makes the extension run `databricks auth login`, whose browser OAuth challenge defaults to a 1-hour timeout in the bundled CLI. In WSL the Linux CLI cannot open the Windows browser or receive the localhost callback, so the flow never completes and the extension appears to hang indefinitely on "Attempting to configure auth: databricks-cli" (#1917). The user is left with no feedback and no guidance. *What* - Pass `--timeout 300s` to `auth login` so a non-completing browser flow fails fast (5 min is ample for a human login, far below the 1h default). - On login failure, surface an actionable error telling the user to run `databricks auth login --profile <p>` (or `--host <h>`) in a terminal and reload, instead of only the raw CLI error. - Make the exec function injectable on DatabricksCliCheck so login argument-building and error handling are unit-testable without spawning the real CLI. This is the pragmatic fix for the reported symptom (the hang). The underlying token-cache host/profile split-brain is a separate CLI-side issue tracked upstream; it is not required to stop the hang. *Verification* - New DatabricksCliCheck.test.ts covers: bounded --timeout passed with a profile, --host used without a profile, and the actionable failure message. - tsc --noEmit clean; eslint and prettier clean on the changed files. - (The repo's VS Code mocha harness cannot run under this env's Node 26 due to an unrelated transitive dep; behavior was verified against the compiled output with the SDK/vscode modules stubbed.)
Contributor
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Contributor
Author
|
[EMU] Integration tests: https://github.com/databricks-eng/eng-dev-ecosystem/actions/runs/27832465346 |
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.
Why
Fixes #1917.
With
auth_type=databricks-cli, a stale/expired cached token makes the extension rundatabricks auth login, whose browser OAuth challenge defaults to a 1-hour timeout in the bundled CLI. In WSL the Linux CLI cannot open the Windows browser or receive the localhost callback, so the flow never completes and the extension appears to hang indefinitely on "Attempting to configure auth: databricks-cli" — with no feedback and no guidance.This PR fixes the hang (the reported symptom). The underlying token-cache host/profile split-brain that triggers the re-login is separate CLI-side state; the broader direction there is profile-first token caching handled upstream in the Databricks CLI, and a one-time
databricks auth login --profile <name>resolves it permanently in the meantime. See the issue thread for the full root-cause walkthrough.What
--timeout 300stoauth loginso a non-completing browser flow fails fast (5 min is ample for a human login, far below the 1h default) instead of stalling.databricks auth login --profile <p>(or--host <h>) in a terminal and reload, instead of only the raw CLI error.DatabricksCliCheckso login argument-building and error handling are unit-testable without spawning the real CLI.Verification
DatabricksCliCheck.test.tscovers: bounded--timeoutpassed with a profile,--hostused without a profile, and the actionable failure message.tsc --noEmitclean; eslint and prettier clean on the changed files.