Skip to content

fix(sandbox): bound every wsl.exe call with a timeout - #205

Merged
quickbeard merged 1 commit into
mainfrom
sandbox-wsl-timeouts
Aug 12, 2026
Merged

quickbeard merged 1 commit into
mainfrom
sandbox-wsl-timeouts

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

The sandbox package's runWsl had no timeout, unlike the desktop's wsl/runtime.ts, which learned the hard way that wsl.exe produces no output and never exits when the LXSS service or a distro is wedged (pending first-run prompt, Windows update mid-flight). Any such wedge would have hung sandbox create/start/availability flows forever.

  • runWsl now defaults to a 20s ceiling, kills the child on expiry, and rejects with the command line and timeout in the message
  • --import overrides to 15min — it unpacks a multi-hundred-MB rootfs into a fresh vhdx
  • --unregister overrides to 5min — disk deletion scales with how much the sandbox wrote
  • The boot command path is unchanged: it was already bounded by startTimeoutMs + health polling

Fork-only files, so no DIVERGENCES row. Two new tests (hung child killed and rejected; fast exit clears the timer); package suite 73 pass / 2 skip.

🤖 Generated with Claude Code

wsl.exe produces no output and never exits when the LXSS service or a
distro is wedged (pending first-run prompt, Windows update mid-flight),
which would hang the sandbox flows forever — the same lesson the
desktop's wsl/runtime.ts already encodes. runWsl now defaults to a 20s
ceiling and kills the child on expiry; --import gets 15min (it unpacks
a multi-hundred-MB rootfs into a fresh vhdx) and --unregister 5min
(disk deletion scales with sandbox writes).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@quickbeard
quickbeard merged commit e78bd2c into main Aug 12, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the sandbox-wsl-timeouts branch August 12, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant