Skip to content

fix(pm-stack): stack sentinel flaps on single probe timeouts — paging Drew for load spikes #9049

Closed

Description

@developing-today-fleet

Problem

Drew is being paged by PM-stack "front-end fails" that are not failures. The stack sentinel (pm-stack/aggregator/scripts/stack-sentinel.ts) flips a service to down on a single failed probe and posts the transition to the alert throat; the aggregator's notification engine then pages on the resulting stack-health candidate whenever the 6h cooldown has lapsed.

Diagnosis (2026-11-12, live laptop state):

  • ~/.local/state/pm-aggregator/notifications.jsonl: 433 notification events today, 30 sent. service:projector alone: 118 events, 4 sent; service:opencode flapped the same way.
  • pm-projector.service never crashed — active (running) since 2026-11-10, same PID. What fails is the probe: probe failed: The operation timed out (3s probe timeout) while the laptop sits at load average 8–10 under the fleet burn. One slow probe → down; next round answers → recovered; repeat.
  • The projector itself is fine; the health signal cries wolf under load.

Fix

Flap damping in the sentinel:

  • A service flips to down (for state + notification purposes) only after 3 consecutive failed probes at the 30s cadence (~90s of continuous failure). A single failed probe never flips state and never posts.
  • Probe timeouts for the 3s probes (projector, kaneo, dispatch, opencode, queue-broker) raised to 10s so a slow-but-alive service under load answers in time (aggregator's /board probe already uses 15s).
  • A recovery transition is only ever posted after the corresponding down was actually posted (the postedState bookkeeping already guarantees this; the damping keeps it true — a blip that never became a posted down produces no recovery).
  • The first-sighting baseline is amended to match: a failed first probe now starts the failure streak instead of posting an immediate down (a genuinely down service is still declared after 3 probes, ~90s after sentinel start).
  • Existing notification cooldown + dedupe stay untouched.

health:fleet-feed also sent 4 pushes today but is a different mechanism — a 5-minute feed-staleness window in src/health.ts, not a single-probe flip — and is deliberately out of scope here.

Ordered by Drew, main chat 2026-11-12: "Tune the health check so load spikes stop paging me." Follow-up to #8568 (Phase 1, closed).

Activity

  1. developing-today commented on Nov 12, 2026

    @developing-today
    Contributor
  2. added a commit that references this issue on Nov 12, 2026
  3. developing-today-fleet commented on Nov 12, 2026

    @developing-today-fleet
    ContributorAuthor

    Fixed and verified live.

    • PR fix(pm-stack): damp stack-sentinel flapping — 3 consecutive probe failures before down (#9049) #9053, merged ba12d12d — new src/sentinel-damping.ts fold (3 consecutive failed probes before down; recovery only after a posted down; legacy state entries migrated at load), sentinel probes folded through it, probe timeouts 3s → 10s (aggregator stays 15s).
    • Tests: 12/12 new oracle tests pass; neighboring suites (alerts, notifications, health, preferences, section-risk, projector, watchdog) 133 pass — the only failures are the known environmental server-boot flakes (5s hook timeouts under load, one port-4871 bind conflict with the live aggregator), unrelated to this change. No tsc errors in touched files.
    • Deploy: pm-stack-sentinel.service restarted 2026-11-12 22:06:09Z (new PID 1978485) on the merged code. Deploy note: the primary checkout is 38+ commits behind main and pm-git-sync is failing on another change's uncommitted .opencode/opencode.jsonc dirt (left untouched); the three merged files were checked out from origin/main byte-identical into the primary, so the running code is exactly main's.
    • Observation window (~13 min post-restart, 5 samples): notifications.jsonl 1065 → 1065 lines (zero new events, zero sends); all six services up at every sample; the aggregator's stack-health.json recorded no transitions; zero transition posts in the sentinel journal; /board, /api/attention.json, /api/quota.json all 200 before and after.
    • Honest caveat: laptop load fell during the window (8–10 → ~3–6.5) and no probe timed out at a sampled round, so the window demonstrates zero paging and stable state, while the blip-absorption behavior itself is pinned by the unit tests rather than a captured live blip.

    health:fleet-feed was left as-is per the issue scope (different mechanism: 5-minute feed-staleness window).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions