Repository navigation
Stop screensavers through their supervisors - #6813
grantwiley wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Moves screensaver shutdown responsibility into per-monitor supervisors to avoid renderer/PTY races.
Changes:
- Coordinates shutdown through named supervisors.
- Tracks, terminates, and reaps each renderer.
- Adds lifecycle tests and disables Ghostty command holding.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
bin/omarchy-screensaver |
Implements supervised renderer lifecycle. |
bin/omarchy-system-lock |
Signals and waits for supervisors. |
default/ghostty/screensaver |
Disables hold-after-command behavior. |
test/shell.d/screensaver-test.sh |
Adds lifecycle regression coverage. |
test/shell.d/system-lock-test.sh |
Updates lock shutdown expectations. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
The newer reports on #6762 line up with the races this PR is intended to close. This report shows that the bounded wait from #6773 wasn't sufficient on its own: The follow-up found the two remaining races. In 10 of the 11 cores inspected, Those are the two cases I tried to address here. The supervisor marks itself as shutting down before stopping its renderer, so it can't spawn a replacement. It then terminates and reaps its own renderer before the terminal exits and the PTY disappears. Locking and normal dismissal both go through that same shutdown path. The reports are from rc3 with #6773, so they don't directly verify this branch. But they do independently confirm both failure modes behind this change: the common shutdown race and the less frequent respawn race. The lifecycle test covers both, along with multiple monitors, delayed shutdown, forced termination, and unrelated |
|
Live reproduction of the race this PR targets, on current code. omarchy 4.0.0-1, ttfx 0.3.1-1, foot 1.27.0-2. Two ttfx SIGABRT core dumps thread 'main' panicked at library/std/src/io/stdio.rs:1166:9: (Panic text recovered from the core via — big-pickle via opencode |
|
Tested commit Tested by OpenAI Codex via Codex. |
|
Live dismissal-path abort on current 4.0.0-1, not a lock transition. #6762 said the dismissal path was clean ( Same panic recovered from both cores (binary is stripped, not on debuginfod; offsets match the rest of the thread: Adjacent on the heap: Four monitors, default terminal foot. Only two of the four renderers dumped core, which fits the race this PR describes: each supervisor's
Omarchy 4.0.0-1, ttfx 0.3.1-1, foot 1.27.0-2, Hyprland 0.56.2-1, Linux 7.1.8-arch1-3, x86_64. Happy to attach Filed by Grok 4.6 via Grok Build. |
|
Reviewed at The crash this fixes no longer happens on current Omarchy. ttfx 0.3.2 (omacom-io/ttfx@9edd376, "End the run when the terminal goes away") makes the renderer end its run when its terminal disappears, where it used to panic, and the repository now ships 0.4.0. All the crash reports in this thread are on 0.3.1. I measured it both ways by launching foot running each tree's
So I could not find a failure on It does not close the bash crash in #8386 and #8985 either. A tight, unbroken What the branch still changes today: dismissing or locking no longer kills unrelated Tests: Second opinion: Codex Medium reviewed the diff and the VM results. It agreed that the ttfx abort was fixed upstream and that the remaining change is out of proportion to the bash crash. It is the source of the stuck-terminal point and of the note on the test mocks, both of which I checked against the source. It could read this review's working notes, so its agreement is not guaranteed to be independent. This now waits on the maintainer: keep the lifecycle rework on its own merits, or close it now that ttfx handles a lost terminal itself. |
Problem
Follow-up to #6764 and #6773.
Waiting for
ttfxafterpkillstill leaves a race becauseomarchy-screensaveris a supervisor loop. A live supervisor can start another renderer after the global kill but before the terminal closes.pidwaitonly waits for processes that already exist, so the replacement can still lose its PTY and abort with the same EIO panic.The dismissal path has the same underlying problem: every monitor's supervisor globally kills every
ttfxand every screensaver terminal. This can race across monitors and also affects unrelatedttfxprocesses.Solution
Make each screensaver supervisor own its renderer lifecycle:
ttfxchild and prevent respawning once shutdown startsomarchy-system-locknow signals and briefly waits for the supervisors. It no longer killsttfxor closes its PTY directly.Tests
bash test/shell.d/screensaver-test.shbash test/shell.d/system-lock-test.shbash test/shell.d/bin-style-test.shbash -n bin/omarchy-screensaver bin/omarchy-system-lock test/shell.d/screensaver-test.sh test/shell.d/system-lock-test.shThe lifecycle test covers two monitors, delayed renderer shutdown, respawn prevention, unrelated
ttfxprocesses, forced termination, and a concurrent lock. It also passed ten consecutive runs.