Skip to content

github-backup(drain): monotonic-only timer can lose its next elapse after unit reload #5157

Closed

Description

@dezren39

Observed failure

On the laptop, github-backup-drain.timer last triggered at 2026-11-01 22:07:10 CST. At the 2026-11-03 verification it reported NextElapseUSecMonotonic=infinity, no realtime next elapse, Trigger: n/a, and the drain-service journal was empty. The timer unit was active but had no scheduled next run. The fetch and reconcile timers continued to fire.

Current unit configuration

At repository main (dcca6cd510866556a00dedb2c92b7d21cf817e2b), infra/github-backup/systemd/github-backup-drain.timer is monotonic-only:

[Timer]
OnBootSec=3min
OnUnitActiveSec=5min
Persistent=true

It has no OnCalendar= trigger. The timer was reactivated at about 22:16 CST during the home-manager unit migration in #3720, so the timing is associated with that reload. However, the recorded last service trigger at 22:07 is recent enough that an OnUnitActiveSec anchor would ordinarily be expected. The available evidence does not establish the precise systemd state transition that produced infinity; confirm that mechanism during implementation rather than assuming the migration discarded an otherwise valid anchor. Persistent=true applies to calendar timers and does not itself provide a calendar trigger here.

Scoped fix and verification

Give the drain timer a calendar-based five-minute trigger, independent of the service's last activation, for example:

[Timer]
OnCalendar=*:0/5
OnBootSec=3min
Persistent=true

Keeping OnBootSec is optional if the calendar schedule alone is sufficient for the first run. Reload/restart the user timer and verify a finite next elapse plus one successful drain tick. Add a runbook or test check that every github-backup timer has a finite next elapse after unit installation/reload.

Relations

Acceptance criteria

  • github-backup-drain.timer has a calendar-based five-minute trigger that is independent of the service's last activation (not monotonic-only).
  • After a unit reload / daemon-reload, the timer reports a concrete next elapse (never NextElapseUSecMonotonic=infinity with no realtime elapse) and the drain service actually runs on the cadence.
  • The mechanism that produced the infinity state is confirmed during implementation, or the calendar trigger is verified to fire across a reload regardless of that mechanism.
  • The fetch and reconcile timers' behaviour is unchanged.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    app/github-backupinfra/github-backup estate mirror system
    on Nov 3, 2026
  2. added
    effort/sSmall: expected under 2 hours of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 4, 2026
  3. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Intake review

    • Related: Fold script-installed laptop user units into the flake (github-backup, worktree-reaper, quota exports, dashboard-backup, oc-password-sync) #3720 (home-manager unit migration during which the timer was reactivated); no merged or open PR found addressing the drain timer's trigger — still live.
    • Notes: Well-evidenced laptop observation (timer active, no next elapse, empty drain journal while sibling timers fire). The body is careful not to over-claim the systemd mechanism — the implementing worker should confirm it rather than assume the migration discarded the anchor.
    • Risks: A calendar trigger changes catch-up semantics (Persistent= on the calendar trigger will run a missed drain at boot — desirable here, but note it).
    • Suggested approach: Add OnCalendar= (5-minute cadence) alongside or instead of the monotonic anchors in infra/github-backup/systemd/github-backup-drain.timer, reload on the laptop, and verify a next elapse plus an actual drain run.

    🤖 Fleet monitor intake pass, 2026-11-03 run.

  4. added
    queue/claimedQueue worker lifecycle state
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 4, 2026
  5. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    {"kind":"handoff","task":9463,"lane":"code-v","execution_lane":"opencode","state":"parked","note":"task 9463 (triage) handed off to opencode claimant by lane code-v. Fresh revalidation: issue #5157 OPEN, no hard-stop labels, no prior task progress — claimant triages the github-backup drain monotonic-only timer elapse loss from scratch."}

  6. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    work/assignedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 4, 2026
  7. 19 remaining items

  8. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: OpenCode lane claimant (opencode-claimant)
    • Session / ID: task 9463; OpenCode session ses_e5e563922fbffewkWbJ7at6yU8
    • Found via: OpenChamber scheduled-task fire; claimed queue handoff
    • Task: Launched and bound the assigned OpenCode worker for task 9463 on issue github-backup(drain): monotonic-only timer can lose its next elapse after unit reload #5157.
    • Expectation: m — worker will revalidate the issue and packet, then record a terminal queue state.
    • Links: OpenCode session ses_e5e563922fbffewkWbJ7at6yU8
  9. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    Triage for task 9463: the defect remains actionable on current main. gh api reports main at 1cf701651abdbdfbbd016fc64fdf045999b26e52; infra/github-backup/systemd/github-backup-drain.timer still has OnBootSec=3min, OnUnitActiveSec=5min, and Persistent=true, with no OnCalendar= trigger. The reported active-but-unscheduled state (NextElapseUSecMonotonic=infinity, no realtime next elapse, empty drain journal) is documented in this issue; I did not independently reproduce it on the live laptop in this session. Fresh PR searches found no superseding fix. Scoped route: add a calendar-based five-minute trigger to the drain timer, then verify a finite next elapse and an actual scheduled drain run after reload; confirm fetch/reconcile behavior is unchanged and determine or work around the original monotonic failure mechanism. I am enqueueing that bounded follow-up now.

  10. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  11. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  12. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  13. added a commit that references this issue on Nov 5, 2026
  14. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done (code side) — deployment remainder in darwin-nix

    • Agent: queue worker (repo-worker-code), lane code-b, direct execution lane
    • Session / ID: task 9837, repo-queue-worker-shift-b run 2026-11-04 21:40 CST
    • Task: code-side fix for issue github-backup(drain): monotonic-only timer can lose its next elapse after unit reload #5157 is merged: PR fix(github-backup): give drain timer a calendar cadence (#5157) #5940 (merge f8bac9f) replaces OnUnitActiveSec=5min with OnCalendar=*:0/5 in infra/github-backup/systemd/github-backup-drain.timer (OnBootSec/Persistent retained) and updates the fleet-schedule registry row. Validation on the laptop: systemd-analyze verify on the install-rendered units exits 0; systemd-analyze calendar "*:0/5" normalizes to *-*-* *:00/5:00 with a concrete next elapse; Codex review on PR fix(github-backup): give drain timer a calendar cadence (#5157) #5940 completed with no findings. Fetch/reconcile timers untouched.
    • SET-REMAINDER (deployment, dezren39/darwin-nix): the live laptop units are home-manager symlinks into the Nix store (read-only), so install-units.sh now fails with "Read-only file system" and cannot deploy. The home-manager definition — dezren39/darwin-nix nixos/home/github-backup.nix lines 55–56 — still carries OnBootSec="3min" + OnUnitActiveSec="5min" for the drain timer. Port the same change there (add OnCalendar="*:0/5", drop OnUnitActiveSec), run the home-manager switch on the laptop, then verify: systemctl --user show github-backup-drain.timer reports a finite NextElapseUSecRealtime and a scheduled drain run lands in the journal. Tracked as a SET-REMAINDER entry in the darwin-nix backlog (cross-repo set rule: no separate issue; this issue is the origin record).
    • Expectation: code-side done; runtime acceptance (finite realtime elapse + observed drain tick on the live timer) completes when the darwin-nix remainder lands.
    • Links: PR fix(github-backup): give drain timer a calendar cadence (#5157) #5940 · issue github-backup(drain): monotonic-only timer can lose its next elapse after unit reload #5157 · task 9837
  15. removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/github-backupinfra/github-backup estate mirror systemeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)task/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