Skip to content

fix(android): bound the clean-baseline snapshot load at 60 s - #1149

Merged
V3RON merged 4 commits into
mainfrom
bug/1047
Oct 31, 2026
Merged

V3RON merged 4 commits into
mainfrom
bug/1047

Conversation

@V3RON

@V3RON V3RON commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1047

Status

Implement: done (2/2 green) Review: round 1 + fix-check passed, R1 fixed Hardware: n/a Gate: not run
Next: ready, then gate

Done when

  • A snapshot load that does not finish within 60 s on the driver clock is killed, the emulator shut down, and the reclaim takes the shutdown-and-wipe path (#loadCleanBaseline in src/drivers/android/index.ts; test "ends a standard reclaim whose clean-baseline load never answers...") — checked by the table test's hung case: on the fake clock the load ends between 60 and 61 s, the child is SIGKILLed, emu kill is sent and the next boot uses -wipe-data; a 1 ms, 59 s or 300 s deadline turns it red.
  • A non-zero exit of the load counts as a failed load and takes the same path (same hunk; test "ends a standard reclaim whose clean-baseline load exits non-zero...", the second case of the table, load answering OK with code 1; checked by removing the result.code === 0 check: the case failed on its toEqual({ state: "shutdown", strategy: "wipe" }) assertion).

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 1 blocking, 1 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 43.9M.
Runs: 11. Cost USD: 2.3051. Agent seconds: 840.
Assessment: complete

Written by an agent.

@V3RON

V3RON commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Decision taken

Question. When adb emu avd snapshot load exits non-zero during a standard reclaim, what happens? The triage's fix lists it, but no test pinned it.

Options.

  1. Treat it as a failed load: shut the emulator down and wipe on the next boot. The user sees the device come back as a fresh boot.
  2. Keep today's behaviour: #runOrThrow throws and the reclaim fails. The user sees a reclaim error.

Taken: option 1. The triage report the maintainer marked bug:ready already asks for it. The code on this branch does it. It ends in the same state as a load that times out or prints no OK, and a failed reclaim that leaves the slot stuck is the problem this bug is about. A test case now pins it.

To revert: throw again on a non-zero exit in #loadCleanBaseline and drop the test case.

Written by an agent.

@V3RON

V3RON commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: e478deb
Round fix-check: 3f02dd2

Runs: 11. Cost USD: 2.3051. Agent seconds: 840.
Tokens input 220, output 51783, cache read 3511304, cache write 333130.
- build implementer: claude-sonnet-5-5 87 s $0.1877
- audit implementer: claude-sonnet-5-5 29 s $0.0902
- fix implementer: claude-sonnet-5-5 56 s $0.1388
- review 1 reviewer: claude-sonnet-5-5 233 s $0.2006
- review 1 code both: claude-opus-5-5 170 s $0.9125
- review 1 spec: claude-sonnet-5-5 11 s $0.0725
- review 1 claims: claude-sonnet-5-5 10 s $0.0536
- fix 1 implementer: claude-sonnet-5-5 68 s $0.158
- review fix-check reviewer: claude-sonnet-5-5 107 s $0.1333
- review fix-check code tests: claude-opus-5-5 55 s $0.2937
- review fix-check claims: claude-sonnet-5-5 14 s $0.0642
Finding outcomes: {"fixed":1}. Classes: {"testing 10 time boundary not straddled":1}.
{"findings":[{"id":"R1","role":"code","class":"testing 10 time boundary not straddled","outcome":"fixed","path":"src/drivers/android/index.test.ts","round":"1","fix":"3f02dd2d5ee5edce0cae3b932c545e14548d617d"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 31, 2026 12:12
@V3RON
V3RON merged commit 75ca78c into main Oct 31, 2026
56 checks passed
@V3RON
V3RON deleted the bug/1047 branch October 31, 2026 12:27
@V3RON

V3RON commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Maintainer confirmed the decision above: a clean-baseline load that exits non-zero takes the shutdown-and-wipe path, the same as a load that times out. Kept as shipped in #1149.

Written by an agent.

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.

A reclaim's Android snapshot load can hang without limit and hold the device

1 participant