You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detect unexpected VM exit and terminate wslcsession.exe
When the VM is killed externally (e.g. hcsdiag /kill, kernel panic), the
wslcsession.exe process now detects it and exits cleanly instead of
hanging indefinitely as a zombie.
Implementation:
- Add GetExitEvent() to IWSLCVirtualMachine IDL. The SYSTEM service
duplicates HcsVirtualMachine::m_vmExitEvent via COM system_handle
marshaling so the session process can wait on it.
- WSLCVirtualMachine calls GetExitEvent() during Initialize() and
exposes VmExitedEvent() for consumers to monitor.
- WSLCSession monitors the exit event via IORelay. On unexpected VM
exit, OnVmExited() spawns a thread to call Terminate() (must be a
separate thread to avoid deadlock with IORelay::Stop).
- WSLCSessionManager registers a cleanup callback on HcsVirtualMachine
to terminate sessions when VM exits. Callback is cleared in
~HcsVirtualMachine to avoid firing during normal shutdown.
- Harden Terminate() to skip dockerd signal/wait and unmount when the
VM is already dead, avoiding unnecessary 30s+ hangs.
- Add tests: VmKillTerminatesSession, VmKillFailsInFlightOperations,
CleanShutdownStillWorks.
0 commit comments