Commit a56cb82
authored
Bound databricks-cli login timeout to fix indefinite WSL hang (#1921)
## Why
Fixes #1917.
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" — 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
- 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)
instead of stalling.
- 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.
## 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.1 parent a27514c commit a56cb82
2 files changed
Lines changed: 137 additions & 12 deletions
File tree
- packages/databricks-vscode/src/configuration/auth
Lines changed: 81 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
Lines changed: 56 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
| |||
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
20 | 49 | | |
21 | 50 | | |
22 | 51 | | |
23 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
24 | 56 | | |
25 | 57 | | |
26 | 58 | | |
| |||
107 | 139 | | |
108 | 140 | | |
109 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
110 | 153 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 154 | + | |
120 | 155 | | |
121 | 156 | | |
122 | 157 | | |
123 | 158 | | |
124 | 159 | | |
125 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
126 | 169 | | |
127 | | - | |
| 170 | + | |
| 171 | + | |
128 | 172 | | |
129 | 173 | | |
130 | 174 | | |
| |||
0 commit comments