Fix EmulatorRunner early exit detection and macOS fork handling#313
Closed
rmarinho wants to merge 1 commit intofeature/emulator-runnerfrom
Closed
Fix EmulatorRunner early exit detection and macOS fork handling#313rmarinho wants to merge 1 commit intofeature/emulator-runnerfrom
rmarinho wants to merge 1 commit intofeature/emulator-runnerfrom
Conversation
Add early process exit detection in BootEmulatorAsync boot polling loop. Previously, if the emulator failed immediately (e.g., insufficient disk space, missing AVD), the full 300s timeout was wasted before reporting. On macOS, the emulator binary forks the real QEMU process and the parent exits with code 0 immediately. Only non-zero exit codes are treated as immediate failures; exit code 0 continues polling since the real emulator runs as a separate process. Context: dotnet/android#10965 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
Closing — changes cherry-picked directly into |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds early process exit detection to
EmulatorRunner.BootEmulatorAsync, fixing two issues discovered while investigating dotnet/android#10965.Related PRs:
Problem 1: No early failure detection
The boot polling loop had no check for
emulatorProcess.HasExited. If the emulator fails immediately (e.g., insufficient disk space, missing AVD, bad config), the full 300s timeout is wasted before reporting failure.Problem 2: macOS fork behavior
On macOS, the emulator binary forks the real QEMU process and the parent exits with code 0 immediately. Without handling this, any
HasExitedcheck would incorrectly treat a successful fork as a failure.Fix
Check
emulatorProcess.HasExitedduring polling:LaunchFailed(real error)Testing