Commit 017f1d6
committed
Stop the new backend before rolling back a failed WSL toggle
Two follow-ups from the latest review pass:
- main.ts WSL_SET_CONFIG_CHANNEL: when startBackend() succeeded but the
readiness wait then failed (e.g. a slow first WSL boot exceeding the
60s timeout), the spawned child kept running under the new mode while
the on-disk config and renderer state silently reverted, leaving
runtime and persisted state inconsistent until the next backend exit.
Stop the new-mode child explicitly, save the previous config, and
relaunch under it; if the rollback start also fails, fall back to the
exponential-backoff restart so the loop keeps trying.
- wsl.ts runWslShellScript: the stdin "error" handler and the catch
around stdin.write/end called settle() without first killing the
spawned wsl.exe child, so a stdin failure after spawn left the child
running with no termination path (the timeout that would have killed
it is cleared by settle()). Kill the child before settle() in those
paths to match the timeout-handler shape.1 parent f8bdfa8 commit 017f1d6
2 files changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2016 | 2016 | | |
2017 | 2017 | | |
2018 | 2018 | | |
2019 | | - | |
2020 | | - | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
2024 | 2025 | | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
2025 | 2030 | | |
2026 | 2031 | | |
2027 | 2032 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| 246 | + | |
243 | 247 | | |
244 | 248 | | |
245 | 249 | | |
| 250 | + | |
246 | 251 | | |
247 | 252 | | |
248 | 253 | | |
| |||
0 commit comments