Make the exit library refresh instant #12
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/12/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Exiting after a load or unload blocked for 20 seconds. It turns out that wait
was never measuring anything: the poll loop waited for
"Scan total", andscanner.appprints"Scan finished statistic total all time: [...]". Themarker never matched, so every exit burned all ten 2-second polls.
Measured on the device (PB743K3) on 2026-08-13 with a temporary instrumented
build:
The ceiling was the wait — about 440x the work.
What changed
core/ScanLogholds the completion marker, host-tested againstoutput really captured from the device. The old marker was wrong precisely
because nothing could see it; now a test can.
PbLibrary::refreshmatches the real line and polls every 50 ms instead ofevery 2 s. The 20 s ceiling stays purely as a backstop for a firmware change.
Also explains the old waitpid failure
scanner.appis a GUI task — it attaches shm, opens a framebuffer, loads atheme — and never exits on its own. Waiting on the process waits forever,
which is what the reverted 2026-07-17 attempt hit. The printed line is the only
usable signal, hence match-then-kill.
This corrects the project's own design note, which asserted the scan "genuinely
takes >20s on this device". That was inferred from the ceiling being hit, which
was really the marker mismatch.
Test plan
appears in the native Library
🤖 Generated with Claude Code