fix(rig-control): brightness restore after sleep + kill orphaned fade children - #359
Open
ZacxDev wants to merge 2 commits into
Open
fix(rig-control): brightness restore after sleep + kill orphaned fade children#359ZacxDev wants to merge 2 commits into
ZacxDev wants to merge 2 commits into
Conversation
Three bugs causing dark screen after wake: 1. Race: background fade_blackout overwrites restore — kill the fade process (via PID file) before restoring, make do_wake() blocking 2. Saved brightness of 0 from stale state file — treat 0 as invalid, default to 60 3. DDC-CI flakiness — retry setvcp 3x with 0.5s backoff, tolerates individual failures in fade loops
Two remaining race conditions causing brightness drop after wake: 1. fade_to_zero spawned set_brightness as background children (&); killing the parent left orphans that kept setting brightness to 0. Fix: run set_brightness in the foreground — clean termination on kill. 2. schedule_restore created a systemd-run timer calling raw ddcutil with no retry and no 0-default. Fix: write state file and call 'monitor-blackout.sh restore' instead, which has both.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rescued from a diverged shared checkout
These two commits were authored in an earlier session directly on
mainin the workbench checkout and never pushed. They are moved onto a branch here unmodified — same SHAs, same authorship, no rebase, no squash.3a9cae1a8e82d6Why this had to happen: the workbench's
mainhad diverged fromorigin/main, soship.shcorrectly skipped that host on every deploy (rc8 =skipped:diverged). That host stopped converging — and it is the host that runs the ClickHouse regrowth timer due to fire 2026-08-11. The divergence was silently blocking a scheduled check from receiving its own bug fix.The commits are preserved on this branch and were verified present on origin from a second host before the workbench's
mainwas moved back. Nothing was rebased, force-pushed, or discarded; the workbench's untracked files were left exactly as found.Why this wants review rather than a straight fast-forward
scripts/claude-hooks/tests/test_guard_core.pyandscripts/monitor-blackout.shwere also touched by #356, which unbroke the pytests gate. Per-PR review structurally cannot see a cross-PR interaction, so these changes have never been gated against the tree they now land in. That is exactly what this PR is for.Not yet verified
I have not run the gate on this branch or on the merged tree, and I did not write these changes. Before merging, the merged tree (
main+ this branch) should be built and counted:mainis currently green atcollected=6507 passed=6506 skipped=1 failed=0. Note that an emptynix buildoutput means the derivation was cached, not that nothing ran — read it withnix lograther than treating silence as success.Two loose ends in the workbench checkout, left alone deliberately because they may be live work:
claudedocs/handoff-rig-control-brightness.mdandclaudedocs/proposed-rules-cut/are untracked there. Docs written into a working tree are unsaved work, one routine checkout away from silent deletion.🤖 Generated with Claude Code