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
open: stop an Android emulator whose boot fails before it is ready #4847
#4842 stops the emulator a cold open launched when the open fails after the boot completes. A failure inside the boot is outside that rule. In packages/platform-android/src/readiness/runtime.ts (ensureEmulatorReady), the launched process is terminated only when the request is canceled. When the boot throws for another reason (for example bindLaunchedEmulator fails, or a boot probe fails for a reason other than the deadline), the emulator stays running with no session to own it.
Required behavior
Decide, per boot failure reason, whether the launched emulator is stopped:
A boot that ran out its --timeout keeps booting. This is documented and tested; keep it.
A boot that fails for a non-deadline reason after launch returned a pid: stop the launched process, or state why it is kept.
Fix it at the readiness owner, which holds the launched pid. Do not add a second stop path in open orchestration.
Completion conditions
A unit test in packages/platform-android/src/readiness/runtime.test.ts for each decided reason (terminated or kept).
website/docs/docs/commands.md states the final rule; today it says a boot that failed before the emulator was ready leaves the emulator as it is.
The issue describes a concrete existing behavior: after a non-deadline Android emulator boot failure, ensureEmulatorReady leaves the launched emulator running. It points to the relevant module and specifies expected cleanup behavior, tests, and documentation updates.
Design correction from the review of #4863: the stop does not belong in the readiness code, which this issue's body asks for. A stop there bypasses the daemon's device-shutdown policy denial and the ownership and claim-lock checks that #4842 added. The PR is being reworked so the one existing stop path (withFailedOpenLaunchCleanup in the daemon) also covers the boot: readiness reports the launch as soon as it has the pid, and a boot that fails for a non-deadline reason goes through that path with all its gates. A spent startup budget keeps the emulator booting and reports kept_running with boot-timeout.
Fixed by #4863, merged into 0.22. A cold boot that fails for a reason other than a spent startup budget stops the emulator it launched; a timed-out boot keeps booting. The stop passes the device-shutdown policy gate. Live runs (control, timeout, injected failure, policy denied) are on the PR. The ownership check before the stop is tracked in #4867.
Activity
apex-sentinel-staging commentedon Nov 20, 2026
Apex Sentinel · Issue review
Suggested label:
bugThe issue describes a concrete existing behavior: after a non-deadline Android emulator boot failure,
ensureEmulatorReadyleaves the launched emulator running. It points to the relevant module and specifies expected cleanup behavior, tests, and documentation updates.Required sections
thymikee commentedon Nov 20, 2026
Design correction from the review of #4863: the stop does not belong in the readiness code, which this issue's body asks for. A stop there bypasses the daemon's
device-shutdownpolicy denial and the ownership and claim-lock checks that #4842 added. The PR is being reworked so the one existing stop path (withFailedOpenLaunchCleanupin the daemon) also covers the boot: readiness reports the launch as soon as it has the pid, and a boot that fails for a non-deadline reason goes through that path with all its gates. A spent startup budget keeps the emulator booting and reportskept_runningwithboot-timeout.fix(android): stop the emulator a failed cold boot left unowned
fix(android): gate the launched emulator's stop with the shutdown pol…
thymikee commentedon Nov 21, 2026
Fixed by #4863, merged into
0.22. A cold boot that fails for a reason other than a spent startup budget stops the emulator it launched; a timed-out boot keeps booting. The stop passes thedevice-shutdownpolicy gate. Live runs (control, timeout, injected failure, policy denied) are on the PR. The ownership check before the stop is tracked in #4867.fix(android): stop the emulator a failed cold boot left unowned (#4863)
fix(android): stop the emulator a failed cold boot left unowned (#4863)
fix(android): stop the emulator a failed cold boot left unowned (#4863)