GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — power-guard: release() blocks the sampling loop up to ~10s reaping a stalled child, delaying the confirmed sleep command (PR #8025 review finding) · Issue #8183 · developing-today/code

power-guard: release() blocks the sampling loop up to ~10s reaping a stalled child, delaying the confirmed sleep command (PR #8025 review finding) #8183

New issue
Copy link
New issue
Copy link
Closed
Closed
power-guard: release() blocks the sampling loop up to ~10s reaping a stalled child, delaying the confirmed sleep command (PR #8025 review finding)#8183
Copy link
Labels
app/power-guardnixos/services/power-guard battery confirmation daemonarea/nixosNixOS modules and machine configurationeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 10, 2026
Issue body actions

Finding (unaddressed PR review comment)

On PR #8025 (fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, for issue #6534), CodeRabbit raised a stability finding that was never fixed or replied to:

Keep sampling while a stalled child is reaped. If systemd-inhibit does not exit promptly, release() can block the loop for about 10 seconds. This delays the next sample or the confirmed sleep command. Handle stalled reaping without blocking sampling, and confirm inhibitor release before issuing sleep.

  • Source PR: fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025
  • Comment: fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 (comment) (comment id 4511572429)
  • Reviewer: coderabbitai[bot], 2026-11-09T10:10:56Z
  • Location: nixos/services/power-guard/power-guard.py, Inhibitor._reap() / release() (lines 153–175 at PR head)

No-response evidence

  • The review thread is unresolved (GraphQL reviewThreads checked 2026-11-10) and has no replies — the CodeRabbit comment is the only comment in the thread.
  • PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025's head is unchanged since the comment: the only commit is 2a6abfda8194eb944894b5fc647778f82aa977f5 (2026-11-09T10:04:21Z, before the comment). No fix commit followed.
  • The PR is still open and the comment is more than 24 hours old, so the open-PR grace rule is expired.
  • No existing issue covers this (searched open/recently-closed issues for power-guard / inhibitor / release on 2026-11-10; issue power-guard: a dead systemd-inhibit child is never noticed — held stays true forever, engage() is a no-op, and the machine is silently unguarded #6534 covers dead-child detection, not reap blocking).

Still-live evidence (PR head 2a6abfda81, read 2026-11-10)

nixos/services/power-guard/power-guard.py:

  • _reap() (lines 153–175) waits synchronously: proc.wait(timeout=5), and on timeout escalates to kill() and waits another 5 seconds — up to ~10 seconds of blocking in the caller.
  • release() calls _reap() synchronously (line 253), and main() calls release() inline in the sampling loop — both on the recovery path (line 292) and, critically, on the confirmed-sleep path (lines 310–312), where the sleep command is only issued after release() returns. A stalled child therefore delays an already-confirmed emergency sleep by up to ~10 seconds on a critical battery, and delays every other sample while reaping.

Note the interaction with the companion finding from the same review (release forgetting a still-running child): the fix must keep sampling/reaping from blocking the loop without dropping the requirement that inhibitor release is confirmed before the sleep command is issued.

Acceptance criteria

  • Reaping a stalled systemd-inhibit child no longer blocks the sampling loop for the full double-wait; sampling continues while reaping is pending, and the confirmed-sleep path still does not issue the sleep command until inhibitor release is confirmed; or the current behavior is resolved by a documented decision recorded on this issue.
  • The existing timeout and kill-escalation safeguards are preserved.
  • Regression coverage: a fake child that ignores terminate/kill exercises the non-blocking reap path in test_power_guard.py.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    on Nov 10, 2026
  2. developing-today commented on Nov 10, 2026

    @developing-today
    developing-todayBot
    on Nov 10, 2026 – with developing.today
    Contributor
    More actions

    CODE-2418

  3. dezren39
    added
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    area/nixosNixOS modules and machine configuration
    source/pr-comment-reviewFiled by the pr-comment-review job
    app/power-guardnixos/services/power-guard battery confirmation daemon
    on Nov 10, 2026
  4. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: pr-comment-review job
    • Session / ID: pr-comment-review run 2026-11-10 11:54 CST
    • Found via: unaddressed PR comment — PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 review comment fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 (comment) (coderabbitai[bot], 2026-11-09)
    • Task: triage the validated finding: power-guard release() blocks the sampling loop up to ~10s reaping a stalled child
    • Expectation: effort s — queue worker verifies against current code, then fixes or resolves by documented decision
    • Links: source PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025; parent issue power-guard: a dead systemd-inhibit child is never noticed — held stays true forever, engage() is a no-op, and the machine is silently unguarded #6534
  5. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked awaiting triage — Agent: queue worker (repo-worker-code), lane code-u — Session/ID: task 14652, repo-queue-worker-shift-u 2026-11-10 run. Task 14652 (triage) for issue #8183. Fresh check: issue #8183 OPEN, labels: kind/bug, task/triage, status/needs-triage, priority/normal, queue/queued, area/nixos, source/pr-comment-review, app/power-guard. triage belongs to the triage step (#8097 rule 3).

  6. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    on Nov 10, 2026
  7. 24 remaining items

  8. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    Parked — Queue task 14655 is parked for 30 minutes. PR #8188 targets the Drew-owned branch of #8025, so this lane will not merge it there. Checks are pending. Before integration, establish an authorized path and verify that the proposed handling preserves confirmed inhibitor release, including the concern in #8182.

  9. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    state: in-progress
    task: 14655
    lane: code-u
    pr: 8188
    outcome: resumed_fix_pr_exists

    Task 14655 (issue #8183) resumed by lane code-u. The fix already exists as PR #8188 (lane code-w) targeting PR #8025's branch fix/6534-power-guard-dead-child — the only place _reap() exists. Fresh verification this shift: full diff read against the #8183 acceptance (0.5s inline grace, background kill-escalation reap, held stays true while a reap is in flight so no second inhibitor stacks — the #8182 requirement — and the confirmed-sleep path issues sleep only after reap_settled()); python3 -m unittest test_power_guard at head 91de65d: 14 tests OK, including the FakeStalledProc regression. Codex review on PR #8188 failed on Codex usage limits and posted no findings; CodeRabbit skipped (non-default base). PR #8025 carries no held/user/owned/do-not-merge labels, so integration proceeds: merging PR #8188 into #8025's branch now.

  10. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 11, 2026
  11. dezren39
    added a commit that references this issue on Nov 11, 2026

    Merge pull request #8188 from developing-today/queue/14655-8183-reap

    88d1022
  12. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 11, 2026
  13. developing-today
    closed this as completedon Nov 11, 2026
  14. dezren39 commented on Nov 11, 2026

    @dezren39
    dezren39
    on Nov 11, 2026
    MemberAuthor
    More actions

    state: done
    task: 14655
    lane: code-u
    pr: 8188
    outcome: fixed_merged

    Task 14655 complete: PR #8188 merged into PR #8025's branch fix/6534-power-guard-dead-child as 88d1022 (PR #8025 head verified at that commit). The #8183 acceptance is met on that branch: release() no longer blocks the sampling loop on a stalled child (0.5s inline grace, background kill-escalation reap), the confirmed-sleep path still waits for reap_settled() before issuing sleep, the timeout/kill safeguards are preserved with a loud UNCONFIRMED log, and the FakeStalledProc regression test covers it — full suite 14 tests OK in a fresh run this shift. The original CodeRabbit finding thread on PR #8025 was dispositioned with the fix summary.

    This issue stays open until PR #8025 itself merges to main (that PR is #6534's, outside this task's scope); the fix rides with it.

  15. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 11, 2026
  16. dezren39
    added a commit that references this issue on Nov 14, 2026

    fix(power-guard): detect dead systemd-inhibit child, re-engage loudly…

    6dd725c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/power-guardnixos/services/power-guard battery confirmation daemonarea/nixosNixOS modules and machine configurationeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.