Skip to content

fix(healthcheck): give broadcast-orphan-recovery a staleness window - #36

Merged
aryavenkatesan merged 1 commit into
mainfrom
fix/healthcheck-orphan-recovery-window
Jul 29, 2026
Merged

fix(healthcheck): give broadcast-orphan-recovery a staleness window#36
aryavenkatesan merged 1 commit into
mainfrom
fix/healthcheck-orphan-recovery-window

Conversation

@aryavenkatesan

Copy link
Copy Markdown
Collaborator

Found by running the healthcheck on prod for the first time, immediately after installing the systemd timer (suite 35, step 5).

The finding

! beat:broadcast-orphan-recovery   no staleness window configured — add to DEFAULT_STALENESS_HOURS
✓ beat:ingest-events-daily         last run 9.7h ago
✓ beat:scrape-sources-daily        last run 10.2h ago
✗ beat:weekly-digest-sunday        STALE — last run 211.1h ago (> 192h window)

broadcast-orphan-recovery is seeded into the beat schedule by broadcast/0009_seed_orphan_recovery_beat.py but was never added to DEFAULT_STALENESS_HOURS — so its staleness could never fail. That is precisely the ride-along case the dict's own comment warns about:

every task the pipeline depends on belongs here, or its staleness silently passes forever (2026-07-21 scheduler outage)

Given the outage this suite exists to fix was a scheduled task quietly not running, a scheduled task that structurally cannot report staleness is worth closing.

The change

Schedule is 0 */6 * * *, so the window is 6h + 1h grace = 7, matching the +1h pattern the daily entries already use (24 → 25).

Note: DEFAULT_STALENESS_HOURS doubles as the must-exist set in _check_periodic_tasks, so adding the key also makes a missing schedule entry a FAIL. That's safe — the task is created by a migration, so any migrated database has it. I verified this rather than assuming it.

Tests

Boundaries in both directions, so a future retune can't silently widen the window into uselessness:

  • one late interval (6h30m) → still OK
  • two missed intervals (13h) → FAIL

Not addressed here

The weekly-digest-sunday FAIL above is real and separate: beat was dead through Sunday 2026-07-26, so that week's digest was never sent. It is not a healthcheck bug — the check is correctly reporting missed work. Next run is Sunday 2026-08-02, which will clear it.

🤖 Generated with Claude Code

The first real healthcheck run on prod (2026-07-29, right after installing the
systemd timer) reported:

    ! beat:broadcast-orphan-recovery  no staleness window configured

which is exactly the ride-along case the DEFAULT_STALENESS_HOURS comment warns
about: a task seeded into the schedule but never added to the dict, so its
staleness can never fail. The task is seeded by broadcast/0009 and runs
`0 */6 * * *`, so the window is 6h + 1h grace = 7, matching the +1h pattern the
daily entries already use.

Because the dict doubles as the must-exist set in _check_periodic_tasks, adding
the key also makes a missing schedule entry a FAIL. That is safe here: the task
is created by a migration, so any migrated database has it.

Tests cover the window's boundaries in both directions — one late interval is
still OK, two missed intervals FAIL — so a future retune can't silently widen it
into uselessness.
Co-Authored-By: Claude <noreply@anthropic.com>
@aryavenkatesan
aryavenkatesan merged commit 25f96e9 into main Jul 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant