Commit 920873d
authored
fix(backend): fix kubeconfig injection for slow-starting workspaces (CRW-11193) (#1620)
* fix(backend): start polling fallback when watch times out in PostStartInjector
The 60-second watch timeout called cleanup() and silently abandoned
injection without starting the polling fallback. Any workspace that takes
more than 60 seconds to reach Running — which is common — never received
kubeconfig or podman credentials.
Fix: start startPollingFallback() from the timeout handler so injection
can still complete via GET polling (10 s interval, up to 5 minutes).
Fixes: https://redhat.atlassian.net/browse/CRW-11193
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
* fix(backend): increase watch timeout to 120s and log polling elapsed time
- Raise INJECTION_TIMEOUT_MS from 60s to 120s. The watch is a cheap
long-lived HTTP connection, while the polling fallback fires a GET
every 10 seconds. Keeping the watch alive longer reduces unnecessary
polling for workspaces that start between 60s and 120s.
- Log how long the workspace was in Starting phase when injection
completes via polling (e.g. "workspace ready after 95s"), which helps
operators diagnose slow-start clusters.
- Add a comment in startPollingFallback() explaining why the same
devworkspaceApi instance is safe to reuse across watch and polling
(getByName is a standalone REST call, independent of watch state).
Assists: https://redhat.atlassian.net/browse/CRW-11193
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
* fix(backend): increase watch timeout to 300s to match startTimeout
Align INJECTION_TIMEOUT_MS with the server-side startTimeout default
(300 s). The watch is a cheap long-lived HTTP connection that should
stay alive for the full startup window rather than falling back to
polling at 120 s.
Assists: https://redhat.atlassian.net/browse/CRW-11193
Assisted-by: Claude Sonnet 4.6
Signed-off-by: Oleksii Orel <oorel@redhat.com>
---------
Signed-off-by: Oleksii Orel <oorel@redhat.com>1 parent 38203bd commit 920873d
2 files changed
Lines changed: 44 additions & 6 deletions
File tree
- packages/dashboard-backend/src/services
- __tests__
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
73 | 80 | | |
74 | 81 | | |
75 | 82 | | |
| |||
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
160 | 170 | | |
161 | 171 | | |
162 | 172 | | |
| |||
195 | 205 | | |
196 | 206 | | |
197 | 207 | | |
| 208 | + | |
198 | 209 | | |
199 | 210 | | |
200 | 211 | | |
| |||
212 | 223 | | |
213 | 224 | | |
214 | 225 | | |
| 226 | + | |
215 | 227 | | |
216 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
217 | 233 | | |
218 | 234 | | |
219 | 235 | | |
| |||
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
200 | 204 | | |
201 | | - | |
| 205 | + | |
202 | 206 | | |
| 207 | + | |
203 | 208 | | |
204 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
205 | 227 | | |
206 | 228 | | |
207 | 229 | | |
| |||
0 commit comments