Review 2026-12-02 Phase 3: Alarm pipeline correctness #254

Closed
opened 2026-12-02 16:07:38 -05:00 by dohertj2 · 1 comment
Owner

Phase 3 — Alarm pipeline correctness (p1)

# Finding(s) Change
3.1 MXA-001 When subscription fails, PollOnce reports a failure (it is not a no-op) and does not reset the failure counter. Failover then engages, and "recovered" is reported only after a successful poll.
3.2 SEC-005, DSH-005 On monitor restart, emit a provider-status frame and Clear frames for every cached alarm that is absent from the new snapshot (diff, don't drop). New /hubs/alarms connections get the current active snapshot and provider status on connect.
3.3 SEC-006, SEC-009 Version reconcile snapshots: ignore a snapshot older than the last applied live transition, detect a same-state re-raise by timestamp/sequence, and log or metric a non-OK reconcile reply.
3.4 SEC-007 An ack for an alarm not in the cache updates history only; it does not insert an ActiveAcked row.
3.5 MXA-005, MXA-007 Subtag fallback ignores bad or null-quality InAlarm updates (it holds state and marks the provider degraded). Buffer an early Acked until InAlarm arrives at initial sync.
3.6 SEC-008, SEC-010 Cache the watch-list query and fingerprint, refreshing on an interval or a deploy event, not every reconcile tick, and move it out of the failover event loop. Restart backoff becomes exponential with a cap.
3.7 SEC-011 Validate Alarms:ReconcileIntervalSeconds (> 0) and put an upper bound on Events:ReplayRetentionSeconds.
3.8 SEC-013 Constraint JSON deserialization turns a missing list member into an empty list (not null); add a load-time check so a null browse scope can't fall through.

Verify: GatewayAlarmMonitor*, AlarmsHub*, and Worker.Tests alarm classes on windev. Live check of failover (3.1) and subtag quality (3.5) on the dev rig; the rig's alarms are driven by object logic, so use its simulator.

High findings filed separately:


Source: code-reviews/2026-12-02-perf-bugs/README.md and code-reviews/2026-12-02-perf-bugs/PLAN.md (commit f200bda6 on local branch docs/review-2026-12-02-perf-bugs, not yet pushed). Reviewed at 54367e74.

## Phase 3 — Alarm pipeline correctness (p1) | # | Finding(s) | Change | |---|---|---| | 3.1 | MXA-001 | When subscription fails, `PollOnce` reports a failure (it is not a no-op) and does not reset the failure counter. Failover then engages, and "recovered" is reported only after a successful poll. | | 3.2 | SEC-005, DSH-005 | On monitor restart, emit a provider-status frame and Clear frames for every cached alarm that is absent from the new snapshot (diff, don't drop). New `/hubs/alarms` connections get the current active snapshot and provider status on connect. | | 3.3 | SEC-006, SEC-009 | Version reconcile snapshots: ignore a snapshot older than the last applied live transition, detect a same-state re-raise by timestamp/sequence, and log or metric a non-OK reconcile reply. | | 3.4 | SEC-007 | An ack for an alarm not in the cache updates history only; it does not insert an `ActiveAcked` row. | | 3.5 | MXA-005, MXA-007 | Subtag fallback ignores bad or null-quality `InAlarm` updates (it holds state and marks the provider degraded). Buffer an early `Acked` until `InAlarm` arrives at initial sync. | | 3.6 | SEC-008, SEC-010 | Cache the watch-list query and fingerprint, refreshing on an interval or a deploy event, not every reconcile tick, and move it out of the failover event loop. Restart backoff becomes exponential with a cap. | | 3.7 | SEC-011 | Validate `Alarms:ReconcileIntervalSeconds` (> 0) and put an upper bound on `Events:ReplayRetentionSeconds`. | | 3.8 | SEC-013 | Constraint JSON deserialization turns a missing list member into an empty list (not `null`); add a load-time check so a `null` browse scope can't fall through. | **Verify:** `GatewayAlarmMonitor*`, `AlarmsHub*`, and Worker.Tests alarm classes on windev. Live check of failover (3.1) and subtag quality (3.5) on the dev rig; the rig's alarms are driven by object logic, so use its simulator. **High findings filed separately:** - [ ] #249 MXA-001 - [ ] #250 SEC-005 --- Source: `code-reviews/2026-12-02-perf-bugs/README.md` and `code-reviews/2026-12-02-perf-bugs/PLAN.md` (commit `f200bda6` on local branch `docs/review-2026-12-02-perf-bugs`, not yet pushed). Reviewed at `54367e74`.
dohertj2 added the area:gatewayarea:workerpriority:p1type:review-finding labels 2026-12-02 16:07:38 -05:00
Author
Owner

Merged to main at 68043411 (pushed 2026-12-03). Gateway suite 1610 passed / 0 failed (macOS); windev worker CI 836 passed / 0 failed on that SHA.

All rows 3.1–3.8 done. Deviations: 3.6 failover-edge watch-list refresh stays inline but capped at 10 s (ordering test) with a deploy-time cache; ReconcileIntervalSeconds validated ≥ 1. Live rig check for 3.1/3.5 not run (object-driven alarms). Pre-existing flake: LiveClearMatchingReconcileClearRepair_IsSuppressed (~1/10 on the base too).

Merged to `main` at `68043411` (pushed 2026-12-03). Gateway suite 1610 passed / 0 failed (macOS); windev worker CI 836 passed / 0 failed on that SHA. All rows 3.1–3.8 done. Deviations: 3.6 failover-edge watch-list refresh stays inline but capped at 10 s (ordering test) with a deploy-time cache; `ReconcileIntervalSeconds` validated ≥ 1. Live rig check for 3.1/3.5 not run (object-driven alarms). Pre-existing flake: `LiveClearMatchingReconcileClearRepair_IsSuppressed` (~1/10 on the base too).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dohertj2/mxaccessgw#254