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() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) · Issue #8182 · developing-today/code

power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182

New issue
Copy link
New issue
Copy link
Closed
Closed
power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding)#8182
Copy link
Assignees
dezren39
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/highImportant and time-sensitivesource/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 Major stability finding that was never fixed or replied to:

Keep the child until release is confirmed. If the child remains alive after both waits, release() forgets it and logs success. The inhibitor can then continue blocking sleep without a cleanup retry. Retain the child until it exits, and report an unsuccessful release instead.

  • 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 4511572439)
  • Reviewer: coderabbitai[bot], 2026-11-09T10:10:56Z
  • Location: nixos/services/power-guard/power-guard.py, Inhibitor.release() (lines 233–254 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: 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 is the parent dead-child-detection issue that PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 addresses; the release-path defect below is distinct. Searched open/recently-closed issues for power-guard / inhibitor / release on 2026-11-10.

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

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

  • Line 233–234: release() copies self.proc to a local and immediately sets self.proc = None — the child is forgotten up front.
  • Lines 253–254: after terminate(), rc = self._reap(proc) is followed by an unconditional log(f"INHIBIT released (child exit={rc})").
  • _reap() (lines 153–175) returns proc.poll() when the post-kill wait raises — and poll() returns None while the child is still running (e.g. stuck in uninterruptible sleep, where even SIGKILL stays pending). In that case release() logs "INHIBIT released (child exit=None)" as success while the systemd-inhibit --mode=block child is still alive and still blocking sleep, and nothing retains a handle to retry cleanup. The machine can stay awake on a critical battery with the journal claiming the inhibitor was released.

Acceptance criteria

  • release() retains the child handle until the child's exit is confirmed (poll()/_reap() shows a real exit), and clears it / logs successful release only after that confirmation; or the current behavior is resolved by a documented decision recorded on this issue.
  • If the child is still alive after the existing waits, the release is reported as unsuccessful (loud log), not as "INHIBIT released".
  • Regression coverage: a fake child whose poll() still returns None after terminate + kill + waits exercises the retained-handle / unsuccessful-release path (the PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 review also noted the inhibitor failure paths in test_power_guard.py lack such cases).

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
    priority/highImportant and time-sensitive
    queue/queuedHas a queued queue task
    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-2417

  3. dezren39
    added
    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() forgets a still-running systemd-inhibit child and logs success
    • 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 14651, repo-queue-worker-shift-u 2026-11-10 run. Task 14651 (triage) for issue #8182. Fresh check: issue #8182 OPEN, labels: kind/bug, task/triage, status/needs-triage, priority/high, 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
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 10, 2026
  7. 2 remaining items

  8. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · triaged

    • Agent: triage-step
    • State: triaged
    • Work kind: task/small-fix — a bounded code fix in Inhibitor.release() in nixos/services/power-guard/power-guard.py.
    • Priority: priority/high (already present, kept) — why: brief line 4 (keep the four repos healthy) / line 5 (everything else by usefulness): a false "INHIBIT released" success log can leave a machine awake on a critical battery with no cleanup retry; not fleet-stalling, so not critical under brief line 1.
    • Effort: effort/s (<2h, per the filing note's expectation).
    • Kind: kind/bug (already present).
    • First concrete step: In release() (lines 233–254 at PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 head 2a6abfda81), retain self.proc until poll()/_reap() confirms a real exit instead of clearing it up front; when the child is still alive after the waits, log the release as unsuccessful (loud), not "INHIBIT released".
    • Acceptance check: release() clears the child handle / logs successful release only after confirmed exit; a still-running child yields an unsuccessful-release log; regression test with a fake child whose poll() still returns None after terminate + kill + waits covers the retained-handle path. Companion: power-guard: release() blocks the sampling loop up to ~10s reaping a stalled child, delaying the confirmed sleep command (PR #8025 review finding) #8183 (non-blocking reap) — the two fixes interact and must not drop the confirmed-release requirement.
    • Fix packet: enqueued in repo-health-code-pilot, dedupe repo-health:v1:fix:developing-today/code:issue:8182.
  9. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (triaged packet)

    • Agent: queue worker (repo-worker-code), lane code-o
    • Session / ID: task 14651, repo-queue-worker-shift-o 2026-11-10 run
    • State: Issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182 no longer carries status/needs-triage. Triage-step agent note on issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182 at 2026-11-10T18:34:43Z (state=triaged, work kind task/small-fix, priority/high, effort/s) already triaged it and the fix packet is enqueued separately. Per runbook §1c, this triage packet is completed with outcome triaged — bookkeeping only, no label changes, no work on the fix itself.
    • Links: issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182; source PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025
  10. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-e
    • Session / ID: task 14654, repo-queue-worker-shift-e 2026-11-10 run
    • State: handed_off — execution lane assigned opencode (lane row 6010); scheduled shift is time-bounded and the claimant is the persistent execution session, so the task is parked for the opencode claimant to launch its bound session.
    • Fresh check: issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182 OPEN, no held / user/owned / do-not-merge / do-not-auto-edit labels, no status/needs-triage; PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 OPEN, no held labels.
  11. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off to opencode claimant

    • Agent: queue worker (repo-worker-code), lane code-w
    • Session / ID: task 14654, repo-queue-worker-shift-w 2026-11-10 run
    • State: handed_off — assigned_lane=opencode (lane row 6010). Fresh check: issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182 OPEN, priority/high, no hard-stop labels, no status/needs-triage. Handoff reason (Rule 4, Queue/lane design rules: no by-id blocking by default, optional platform selector, triage separate from fixes #8097): this scheduled shift is time-bounded; the claimant is the persistent execution session.
    • Context for the claimant: the companion finding power-guard: release() blocks the sampling loop up to ~10s reaping a stalled child, delaying the confirmed sleep command (PR #8025 review finding) #8183 was fixed this shift in PR fix(power-guard): reap stalled inhibitor child off the sampling loop (#8183) #8188 (targets PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025's branch fix/6534-power-guard-dead-child, currently awaiting CI). That change retains the child in a pending-reap record and logs INHIBIT release UNCONFIRMED instead of a false success — but after kill escalation is exhausted it stops retrying, so verify it against power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182's stricter acceptance (retain handle until exit confirmed, with cleanup retry) and add the retained-handle regression case; do not duplicate the non-blocking reap work.
  12. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off

    • Agent: queue worker (repo-worker-code), lane code-o
    • Session / ID: task 14654, repo-queue-worker-shift-o 2026-11-10 run
    • State: task 14654 (small_fix) for issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182 is opencode-assigned (assignment row 6010). Handed off to the opencode claimant — scheduled shift is time-bounded; claimant is the persistent execution session (§1b Rule 4).
    • Verified fresh: issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182 OPEN, no hard-stop labels, no status/needs-triage; PR fix(power-guard): detect dead systemd-inhibit child, re-engage loudly, reap on release #8025 OPEN, no labels.
  13. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    Task 14654 (issue #8182) — handed off to opencode claimant, lane B shift 2026-11-10.

    • Lane assignment: opencode, lane row 6010, session_id null.
    • Handoff reason: scheduled shift is time-bounded; claimant is the persistent execution session (Queue/lane design rules: no by-id blocking by default, optional platform selector, triage separate from fixes #8097 Rule 4).
    • Fresh verification: issue power-guard: release() forgets a still-running systemd-inhibit child and logs success — sleep stays blocked with no cleanup retry (PR #8025 review finding) #8182 OPEN, no hard-stop labels, no status/needs-triage.
    • Next: claimant launches the bound opencode session.
  14. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off to opencode claimant — Agent: queue worker (repo-worker-code), lane code-g — Session/ID: task 14654, repo-queue-worker-shift-g 2026-11-10 run. Task 14654 (small_fix) for issue #8182: power-guard release() retains the systemd-inhibit child until exit is confirmed and reports unsuccessful release. Fresh check: issue #8182 OPEN, no held/user/owned/do-not-merge/do-not-auto-edit labels, no status/needs-triage. Execution lane row 6010 = opencode. Checkpointed handed_off with Rule 4 reason; parking task 14654 for 20 minutes for the claimant window.

  15. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    state: done
    task: 14654
    lane: code-w
    issue: "#8182"
    pr: "#8188"

    Decision recorded by lane code-w (task 14654), per this issue's acceptance option 4 (documented decision):

    Issue #8182 asked that Inhibitor.release() retain the systemd-inhibit child until exit is confirmed and report an unsuccessful release instead of forgetting the child and logging success (CodeRabbit Major on PR #8025, thread r4511572439).

    PR #8188 (stacked on PR #8025's head; companion issue #8183; currently OPEN, MERGEABLE, checks QUEUED in the fleet CI stall) implements the substance:

    • The child is never forgotten mid-release: a stalled reap retains the handle in Inhibitor._pending through the full terminate → grace wait → kill escalation, reachable via held / reap_settled() / poll_reap().
    • "INHIBIT released" is logged only with a real exit code. A child still running after the escalation logs loudly: "INHIBIT release UNCONFIRMED: child still running after kill escalation; not believed released".
    • Regression coverage exists: test_stalled_child_reap_moves_off_the_calling_loop (fake child still running after terminate + kill + waits; UNCONFIRMED asserted; lock believed held while the child runs). Suite verified by this lane on PR fix(power-guard): reap stalled inhibitor child off the sampling loop (#8183) #8188's branch: 14/14 tests pass.

    Deliberate divergence from the letter of criterion 1: after the bounded escalation is exhausted and UNCONFIRMED is logged, the handle is cleared (the #8183 design's documented trade-off in the release() docstring) so a child stuck in uninterruptible sleep cannot wedge the sampling loop forever. The release is reported unsuccessful in that state, which is what this issue's safety property actually requires: sleep is never believed unblocked on a silent success.

    Disposition reply posted on the CodeRabbit thread on PR #8025. Task 14654 completes as pr_opened naming PR #8188; when PR #8188 merges (task 14655's CI-wait resume), this issue can close.

  16. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/queuedHas a queued queue task
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 10, 2026
  17. github-actions
    assigned
    dezren39
    on Nov 12, 2026
  18. dezren39
    closed this as completedon Nov 17, 2026
  19. developing-today
    added
    status:done
    on Nov 17, 2026
  20. dezren39 commented on Nov 17, 2026

    @dezren39
    dezren39
    on Nov 17, 2026
    MemberAuthor
    More actions

    Agent note — task 20079: already_done concurrence (lane any-d, 2026-11-17)

    Fresh verification this shift: issue #8182 is CLOSED as COMPLETED (2026-11-17T03:15:21Z, status:done). The fix landed via PR #8188 — MERGED 2026-11-11T03:31:58Z, merge SHA 88d1022 — implementing the task 14654 decision of record (release() retains the systemd-inhibit child until exit is confirmed and reports an unsuccessful release). Task 20079 is the bulk-intake triage follow-on from task 18597; completing it as already_done. No follow-on needed.

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

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

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/highImportant and time-sensitivesource/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.