Both caches of `wsl.exe -l --running -q` (wslrun.running and agent's
wslRunningLocked) kept a failed answer as long as a real one: 3s. When
WSL hangs, each ask waits its whole 10s timeout, under a lock the GUI's
state build waits on (wslUp), and the timed-out wsl.exe is killed but the
Store WSL's own child isn't (CommandContext can't put it in a job), so
the lag came back every few seconds and wsl.exe processes piled up. A
failure is now kept upFailedAge / wslRunningFailedAge (30s). A failure
already reads as "none runs", so nothing is opened on a guess; a real
answer still lasts 3s, so a distro stopped is seen as quickly as before.
Run: go test -p 1 -tags nogui -count=1 ./internal/wslrun -run 'TestUp|TestFind'
and ./internal/agent -run TestWSL (both ok, macOS, sandbox HOME).
TestUpFailedKept and TestWSLRunningFailedKept count wsl.exe asks: a
failure isn't asked again after 3s, is after 30s, and an answer is asked
again after 3s.
Broken by hand: upFailedAge and wslRunningFailedAge set back to 3s ->
TestUpFailedKept and TestWSLRunningFailedKept fail ("a failure was asked
again after 3s: 2 asks"). GOOS=windows and GOOS=linux go vet -tags nogui
./internal/provider ./internal/agent ./internal/wslrun: clean; gofmt clean.
Not tried on Windows. The leftover wsl.exe children of a timed-out run
are not fixed here.
Full suite: SUITE_LINE