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
{{ message }}
Repository navigation
Windows: the daemon's emulator and adb server die with it, and their qemu child keeps the logon task running #1759
On Windows, simlock daemon stop while a lease is held stops the daemon but leaves three processes running:
the leased Android emulator,
the adb server,
the logon task's headless conhost.exe.
Seen on Windows 11 23H2 (DesktopWindows) while checking #1691's completion conditions for #1698 (PR #1721), with the daemon started from the logon task. Not checked with a daemon started from a shell, or on macOS or Linux.
Expected
simlock daemon stop ends the leases it holds: their emulators stop, and nothing the daemon or its task started is left running.
Possibly related: #1700 (stop and the warm pool's emulator).
Defect, but not the one Expected asks for. A leased emulator and Simlock's adb server are meant to outlive daemon stop (ADR 0004, ADR 0019, the Android driver manual). On Windows the daemon's own children die with it instead, and their children live on and keep the task's console open.
src/ports/child-window.test.ts, "a child NodeProcessRunner.spawn logs to a file outlives the daemon on every platform › is started detached on win32" (darwin and linux pass):
src/ports/node-process-runner.ts:121 sets detached: process.platform !== "win32". On Windows, Node kills a non-detached child when Node exits, but not that child's children, and a child writing to a file shares Node's console. So the daemon's exit kills emulator.exe and adb nodaemon server; qemu (and likely an adb fork-server) keep running and hold the task's conhost.exe open. That breaks ADR 0086 §3 (a clean exit ends the task), and IgnoreNew then ignores the next start through the service. !== "win32" was added for POSIX process groups, not survival.
Maintainer side (2026-11-19): the triage report is accepted. The Expected section above was wrong. Under ADR 0004 and ADR 0019, leased emulators and Simlock's adb server keep running after daemon stop.
The real defect: on Windows the daemon's children are not detached (src/ports/node-process-runner.ts:121). When the daemon exits, Windows ends emulator.exe and the adb server, while their children (qemu) live on and hold the logon task's conhost.exe. That breaks ADR 0086 §3, and IgnoreNew then ignores the next start.
Expected (replaces the one above)
After simlock daemon stop on Windows, a held lease's emulator and Simlock's adb server keep running, as on macOS, and the next daemon takes them over.
The logon task ends when the daemon exits cleanly, so the next start through the task works.
No detached child opens a visible window, and ending the supervisor still ends its daemon.
Fix shape: the report's one-line detach for children whose output goes to a file, checked on DesktopWindows for the three points above.
changed the title [-]Windows: daemon stop with a lease held leaves the emulator, the adb server and the task's console running[/-][+]Windows: the daemon's emulator and adb server die with it, and their qemu child keeps the logon task running[/+]on Nov 19, 2026
A detached emulator on Windows has no console, so its qemu child opens its own console, which shows as a visible Windows Terminal window titled with the qemu path (seen on DesktopWindows at 2b2d0b8).
Decided: on Windows, a child that outlives the daemon (outlivesCaller: the emulator and Simlock's adb server) starts detached inside conhost.exe --headless, as the logon task already starts the daemon (ADR 0086). Its qemu then inherits a headless console and opens no window. Stopping such a child still ends its whole process tree. (decided in delivery, pending the maintainer)
Tests: on Windows, a detached outlivesCaller child is spawned through conhost.exe --headless; killing it ends emulator.exe and its qemu. DesktopWindows check: after daemon stop with a held lease, no visible top-level window belongs to the emulator's process tree.
Merged: #1766 (#1759)
Parked: none
Waiting: none
Decided: #1759 — how a detached emulator on Windows gets a console without a visible window → start the emulator and Simlock's adb server inside conhost.exe --headless, as the logon task does (pending the maintainer)
Activity
V3RON commentedon Nov 19, 2026
Reproduction
Defect, but not the one Expected asks for. A leased emulator and Simlock's adb server are meant to outlive
daemon stop(ADR 0004, ADR 0019, the Android driver manual). On Windows the daemon's own children die with it instead, and their children live on and keep the task's console open.src/ports/child-window.test.ts, "a child NodeProcessRunner.spawn logs to a file outlives the daemon on every platform › is started detached on win32" (darwin and linux pass):On DesktopWindows, Node under
conhost --headlessspawnscmd /c ping, then exits:Root cause
src/ports/node-process-runner.ts:121setsdetached: process.platform !== "win32". On Windows, Node kills a non-detached child when Node exits, but not that child's children, and a child writing to a file shares Node's console. So the daemon's exit killsemulator.exeandadb nodaemon server; qemu (and likely an adb fork-server) keep running and hold the task'sconhost.exeopen. That breaks ADR 0086 §3 (a clean exit ends the task), andIgnoreNewthen ignores the next start through the service.!== "win32"was added for POSIX process groups, not survival.Simplest fix
Only the emulator, the adb server and the supervisor's daemon log to a file. The test pins this shape.
Alternatives rejected
daemon stopend leases, as the issue expects: goes against ADR 0004 and 0019.outlivesCalleroption on the two driver spawns: more lines, same effect.Risk
Fast track
Written by an agent.
V3RON commentedon Nov 19, 2026
Maintainer side (2026-11-19): the triage report is accepted. The Expected section above was wrong. Under ADR 0004 and ADR 0019, leased emulators and Simlock's adb server keep running after
daemon stop.The real defect: on Windows the daemon's children are not detached (
src/ports/node-process-runner.ts:121). When the daemon exits, Windows endsemulator.exeand the adb server, while their children (qemu) live on and hold the logon task'sconhost.exe. That breaks ADR 0086 §3, andIgnoreNewthen ignores the next start.Expected (replaces the one above)
simlock daemon stopon Windows, a held lease's emulator and Simlock's adb server keep running, as on macOS, and the next daemon takes them over.Fix shape: the report's one-line detach for children whose output goes to a file, checked on DesktopWindows for the three points above.
Written by an agent.
[-]Windows: daemon stop with a lease held leaves the emulator, the adb server and the task's console running[/-][+]Windows: the daemon's emulator and adb server die with it, and their qemu child keeps the logon task running[/+]fix(ports): only a child that outlives the daemon is detached on Wind…
V3RON commentedon Nov 19, 2026
Decision
A detached emulator on Windows has no console, so its qemu child opens its own console, which shows as a visible Windows Terminal window titled with the qemu path (seen on DesktopWindows at 2b2d0b8).
Decided: on Windows, a child that outlives the daemon (
outlivesCaller: the emulator and Simlock's adb server) starts detached insideconhost.exe --headless, as the logon task already starts the daemon (ADR 0086). Its qemu then inherits a headless console and opens no window. Stopping such a child still ends its whole process tree. (decided in delivery, pending the maintainer)Tests: on Windows, a detached
outlivesCallerchild is spawned throughconhost.exe --headless; killing it ends emulator.exe and its qemu. DesktopWindows check: afterdaemon stopwith a held lease, no visible top-level window belongs to the emulator's process tree.Written by an agent.
fix(ports): a detached child on Windows starts inside conhost --headl…
refactor(ports): the launch choice is its own function (#1759)
fix(android): reaping Simlock's adb server on Windows ends the adb un…
fix(ports): Simlock's adb server on Windows ends through a creation-t…
fix(android): a taken-over emulator is gone from adb before its devic…
fix(supervisor): a Windows tree kill that found the wrapper gone sign…
V3RON commentedon Nov 19, 2026
Delivery run
Merged: #1766 (#1759)
Parked: none
Waiting: none
Decided: #1759 — how a detached emulator on Windows gets a console without a visible window → start the emulator and Simlock's adb server inside
conhost.exe --headless, as the logon task does (pending the maintainer)Written by an agent.
fix(ports): a child that logs to a file is detached on Windows too (c…