Repository navigation
Conversation
|
Reviewed by Claude Opus 5 running in Claude Code, with an independent second opinion from Codex at xhigh reasoning. Tests ran on a disposable Omarchy 4 VM, not on a developer machine: The no-reader case is clean. 1. The tests pass whether or not the hook does what they are named for. Four mutations to the hook each leave
The last two are the ones that matter: not restarting inside the hook is the central design decision of this PR — it is the whole of your "Why stop instead of restart inside the hook?" section — and nothing currently holds it in place. Four added assertions close all four holes, and I verified each by re-running the mutation and watching the new assertion fail: diff against
|
|
Independent confirmation from different hardware than the PR body.
On this machine the surviving daemon does not log What we verified:
Happy to retest this branch on |
|
One integration conflict to resolve before landing: #8441 independently adds the same |
|
Automated duplication check: this pull request looks similar to #7158, which covers the same fprintd resume hook. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
|
The replacement resume-recovery fix has now merged in #7158. It includes the queued fprintd restart, a three-second stop timeout and lock-screen recovery; this alternative remains closed. GPT-6 in Codex and Claude Opus 5.5 Medium checked the coverage against the landed source; Claude's agreement does not guarantee independence. This closure review was read-only and did not rerun runtime tests. |
What this changes
fprintd.service's PID immediately before suspend or hibernate.user.slicehas thawed.Why
The lock screen can begin a fingerprint PAM conversation just as a lid close enters suspend. On the affected machine,
fprintdreportedCannot run while suspended, but the daemon survived with its device claim stuck. After resume, the lock screen retried every 250 ms and receivedPAM_AUTHINFO_UNAVAIL(code 9) until password unlock or the daemon's idle exit.The reader itself remained healthy: stopping the surviving daemon and allowing D-Bus to start a fresh one restored fingerprint verification immediately.
The PID comparison makes the recovery selective. If
fprintdexited during sleep and another system component started a replacement, this hook leaves that new process alone.Why stop instead of restart inside the hook?
System-sleep hooks run while
user.sliceis frozen. Stopping the stale daemon there establishes the ordering we need, but startingfprintdthere would also make wake wait for USB probing and the D-Bus service start. Leaving startup to the next PAM request moves that work after thaw, when the reader has fully resumed.The service stop is bounded at six seconds, one second beyond Omarchy's five-second systemd service-stop timeout. A failure is logged and wake continues.
Hardware validation
Tested on Omarchy 4.0.0-1 with:
27c6:634cfprintd1.94.5-2libfprint1.94.100-1Historical journal data contained three
Cannot run while suspendedevents across twelve lid cycles, followed by a large code-9 retry storm.With this hook installed, the race was reproduced and recovered in three consecutive test cycles:
In every cycle:
The power-state instrumentation used during validation is not included in this patch.
Scope and relationship to other work
This fixes the stale-daemon suspend race reported in #7229 and related evidence in #7172. It deliberately does not change the lock screen's retry policy, unavailable UI, thermal-error handling, or mid-verification driver-error behavior.
#7158 addresses the same stale-daemon diagnosis as part of a broader fingerprint recovery and retry design. This PR offers a narrower alternative: a PID-selective stop, lazy D-Bus activation after thaw, and no QML or retry-policy changes. The approaches could also be combined if maintainers prefer its broader backoff behavior.
One intentional tradeoff is that a fingerprint conversation left open across suspend, such as
sudowaiting in another terminal, is ended and falls back to password. That is the same class of conversation that can otherwise retain the stale claim.Tests
test/shell.d/fprintd-resume-stop-test.shtest/shell.d/fprintd-resume-stop-migration-test.sh./test/cli./test/shell: all relevant tests pass; the sole persistent failure islaunch-about-test.sh, reproduced unchanged on a detachedorigin/quattroworktree. The initially transient screenshot test passed on rerun, and the Snapper coverage passed once its documented siblingomarchy-pkgsandomarchy-isocheckouts were present.@spencerbull, I would value your review of the suspend/service-lifecycle tradeoff here, particularly the selective stop and deferred D-Bus startup versus restarting the service inside the post-resume hook.