Skip to content

Don't retry+reboot on APP_CRASH on Android devices - #17787

Merged
lewing merged 1 commit into
mainfrom
lewing-android-app-crash-retry-fix
Nov 11, 2026
Merged

lewing merged 1 commit into
mainfrom
lewing-android-app-crash-retry-fix

Conversation

@lewing

@lewing lewing commented Nov 10, 2026

Copy link
Copy Markdown
Member

Fixes #17786

When XHarness reports exit code 80 (APP_CRASH) on a physical Android device, xharness-event-processor.py requested an infra retry and a machine reboot. A deterministic crash caused by the product used up all Helix attempts, rebooted a device machine on each one, and then dead-lettered the item (exit -1, no published results or logs). On dotnet/runtime's windows.11.amd64.android.open queue, this dead-lettered 6–8 items per run.

Change

if exit_code == 80 and not (platform == "apple" and is_device) → if exit_code == 80 and not is_device

This is option (a) from the issue: Android devices now follow the rule Apple devices already had.

  • XHarness sets Android isDevice = !serial.StartsWith("emulator"). Physical phones report true and get no retry or reboot. Emulators (false) and items with no device info (None) keep retry+reboot.
  • A crash on an Android device now reaches the existing network connectivity check. If the device lost Wi-Fi, the item still gets a retry (no reboot) and the NoInternet metric is sent. Otherwise the item fails normally with its logs.
  • Nothing else depends on the APP_CRASH reboot. The .retry/.reboot files are only written when a user calls report_infrastructure_failure.
  • I chose (a) over (b), which retries once without a reboot. Helix gives the processor no per-attempt state, and (b) would still spend a second device run on crashes that are deterministic.

To double check:

This script has no test harness. I ran it locally with a stub helix.public module, a fake dotnet on PATH, and synthetic diagnostics.json files, all for exit code 80. The stubs are not committed.

Scenario Result
Android device No retry or reboot; ping check runs
Android device, ping fails Retry only; NoInternet metric sent
Android emulator Retry + reboot
Android, isDevice missing Retry + reboot
Apple device No retry or reboot (unchanged)
Apple simulator Retry + reboot (unchanged)

This has not been tested in a real Helix run.

Note

This PR was AI-generated with GitHub Copilot.

XHarness exit code 80 (APP_CRASH) on a physical Android device requested an
infra retry and a machine reboot. Deterministic, product-caused crashes thus
burned all Helix attempts (rebooting device machines each time) and ended
dead-lettered without published results or logs.

Treat Android devices like Apple devices already are: only emulators and
simulators get retry+reboot for APP_CRASH. Android device crashes now fall
through to the existing network connectivity check, so a crash caused by a
lost Wi-Fi connection still gets a retry (without reboot).

Fixes #17786

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 10, 2026 22:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the physical Android crash-handling change.

No open issues 🎉

What changed in this PR

Updates Helix’s XHarness crash handling so physical Android devices, like Apple devices, no longer trigger infrastructure retries and reboots solely for APP_CRASH (exit code 80).

Changes:

  • Preserves retry-and-reboot behavior for emulators, simulators, and missing device information.
  • Keeps the existing Android connectivity check available to retry network failures.
  • Expands comments to explain the physical-device crash policy.
File Description
src/​Microsoft.DotNet.Helix/​Sdk/​tools/​xharness-runner/​xharness-event-processor.py Excludes physical Android devices from automatic APP_CRASH retry and reboot handling.

Review effort: Balanced

@lewing
lewing merged commit 5f7e3d1 into main Nov 11, 2026
18 checks passed
@lewing
lewing deleted the lewing-android-app-crash-retry-fix branch November 11, 2026 15:17
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xharness-event-processor: Android APP_CRASH (exit 80) retry+reboot turns deterministic product crashes into dead-lettered work items

4 participants