Repository navigation
fix(android): persist the test-IME flush deadline across a daemon restart - #4882
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 45f230e. The verdict and the full list are in the summary comment.
This comment has been minimized.
This comment has been minimized.
|
The code change at e76756c needs one live check before merge. It changes when The two open inline threads on this PR: the one about the unwritable state dir (discussion) no longer applies at this head, because Not blocking, and fine to take or leave: if the post-write record fails (for example ENOSPC), only the issuing kill-bound close keeps the deadline, so an ordinary close followed within 2.5 s by a standalone All 21 checks pass at e76756c. Tests were not run locally. Not verified here: the cross-process clock claim, which relies on libuv |
|
Replying to the review at e76756c (#4882 (comment)). Live emulator restart check: not run yet. It shuts down and cold-boots the emulator, and every Android emulator booted on this host belongs to other work. My brief allows only a device it names, so I'm waiting for one. I'll post the commands, serial, head SHA, timings and record-file contents here once it runs. The unwritable-state-dir thread is already resolved. Optional notes:
|
e76756c to
fddebef
Compare
…tart A confirmed or issued test-IME restore on an emulator owes the SettingsProvider flush window before any adb emu kill. The deadline lived only in the daemon's in-process map, so a restart inside the window let a kill land mid-flush. The deadline is now a durable record in the daemon state dir, stamped on the host monotonic clock and capped at one window, and the Android shutdown runtime reads it through the state dir. Fixes #3346 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-check after clear Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new module grew the mechanics eager closure; the records live beside the recovery markers, which the closure already evaluates. Also drop the now-unused export of the pending-writes map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
platform-android may not read process directly (R13); the root adb host binding owns the hrtime read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…store An unwritable state dir made the pre-write throw before ime set, leaving the device on the test IME. The write failure now warns with a typed diagnostic phase, the restore proceeds, and a kill-bound close holds its own kill for the window it could not record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main's help text for --shutdown changed without regenerating the page, which fails the generated-block guard on every branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fddebef to
a2f6f20
Compare
|
Live emulator restart check, as requested in #4882 (comment). Setup
(1) open, type, close
(2) daemon stop, then standalone shutdown from a new daemon
(3) Cold boot
(4) Open, type, close, wait 3.5 s, shutdown
Cleanup: the AVD is shut down, the daemon is stopped and the T3 device panel is closed. Not covered: Linux time namespaces, since this was a macOS host. Also in this push: |
This comment has been minimized.
This comment has been minimized.
|
The earlier findings on e76756c (#4882 (comment)) are fixed except one regression, which still shows at a2f6f20. An unwritable state dir no longer blocks the restore, because If only Could Android's The open inline thread #4882 (comment) no longer applies at this head, since the unwritable state dir case is handled as described above, so it can be resolved. No other open threads still apply. Only the Body rules check is not passing. It was cancelled at its Checkout step and did not fail on a rule. It checks the PR body, not code, and the latest change (a docs regen) does not touch this route. The other 23 checks pass, and a re-run should settle it. No conflicts are known. The author's live run was on fddebef, not a2f6f20. The match rests on the byte-identical logical patch diff, and the base moved by #4682 (host-kit ps lstart locale), which does not touch this route. Not verified here: the live run timings, which come from the author's comment; Linux time namespaces and the cross-process Before merge, the fallback deadline fix above needs to land, and the cancelled Body rules check needs a re-run so all checks are green. |
… in this daemon When the flush-record directory is unwritable, the deadline lived only in the restoring call, so an ordinary close followed by a standalone shutdown killed inside the window. The shared kill guard now also waits out a process-local fallback deadline; ordinary closes stay wait-free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Replying to #4882 (comment). Fixed in 88fe0de. Fallback deadline (
Simplicity question (could It's possible. All production consumers are in the Android package, and the record functions already live in
Going direct would delete the facet, its root binding and three mechanics exports. But the fixtures would then need an in-memory files implementation for that directory, or the strict stub would have to be loosened. I can do that here or as a follow-up if you prefer it. The new push also reruns the cancelled Body rules check. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 88fe0de. The verdict and the full list are in the summary comment.
… marker clear When the record held an older confirmed window and a newer write failed to record, the kill guard reported covered-confirmed and could clear the retry marker. A fallback deadline newer than the record now reports covered-issued. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
packages/platform-android/src/ime-state.ts:117 |
🆕 Fallback flush deadline is keyed by serial only, so another state dir can consume it |
Reviewed with this repository's own Sentinel configuration (a29f3ea79a59).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on c940db6. The verdict and the full list are in the summary comment.
|
This PR is ready at c940db6. The delta fixes the problem in the earlier review (#4882 (comment)), and no findings remain that must be fixed before merge. Not blocking, and fine to take or leave: after the fallback wait in |
Summary
After a test-IME restore on an emulator,
adb emu killmust wait out the SettingsProvider flush window. The wait lived only in daemon memory, so a restart inside the window letclose --shutdownorshutdownkill mid-flush. Fixes #3346.<stateDir>/android-test-ime-flush/, written before and afterime set. The in-memory map is removed.monotonicNowMson the adb host port). Wall-clock steps can't shorten a window. After a reboot the wait is capped at one window.stateDirthreaded through the shutdown contract; 34 files incl. a commands.md regen.Before / after
Fresh daemon, previous daemon's record 60% of a window from its deadline:
adb emu killruns immediately.Validation
Base
4075dd1178, headc940db65ae.packages/platform-android,src/platform-runtime*, closure budget): pass.🤖 Generated with Claude Code