fix(upgrade-signal): Retry And Alarm On Failed Apply - #4513
Conversation
🟡 Heimdall Review Status
|
| ) -> RpcResult<UpgradeSignalApplySummary> { | ||
| match refresher.read_schedule().await { | ||
| Ok(schedule) => refresher.apply(&schedule).map_err(|error| { | ||
| UpgradeSignalMetrics::record_apply_failure(refresher.metrics_layer, &schedule); |
There was a problem hiding this comment.
Issue: RPC path records apply_failed gauge on failure but never clears it on success
record_apply_failure sets apply_failed to 1.0, but the Ok path of this map_err chain never calls record_apply_success. After a failed RPC-triggered apply followed by a successful one, the gauge stays stuck at 1.0 — the stale alarm is only cleared if the live poller in poll_and_apply later applies the same schedule, or on process restart.
Since admin_refreshUpgradeSignal is the manual operator path, a "fail → succeed" sequence via RPC should clear the gauge. Consider adding UpgradeSignalMetrics::record_apply_success(refresher.metrics_layer, &schedule) on the success path here.
Review SummaryPR: fix(upgrade-signal): Retry And Alarm On Failed Apply The split between FindingRPC |
|
Tip Nice, this PR improves performance. 1 benchmark(s) faster by more than 10% beyond the noise band: Benchmark results (advisory)Median time on the PR head versus the base branch, measured on the same host. Wall-clock, so a change is only flagged when it clears ±10% and the confidence intervals do not overlap. Only benchmarks past the ±10% threshold (plus new or dropped ones) are listed. This check never blocks a merge.
48 benchmark(s) within ±10% omitted. |
Summary
The live upgrade-signal poller advanced its baseline before applying the schedule, so a failed apply left a stale watermark and the same L1 values were never re-offered, and the failure was swallowed as a single warn log. This change splits the observed baseline (drives metrics, unchanged) from an applied baseline that advances only when the runtime commit succeeds, so a failed apply is retried on the next poll instead of being silently adopted. Failures now increment an apply_failures_total counter, raise a sticky apply_failed gauge, and page once per distinct failure. The poll-apply-commit cycle is centralized in the monitor so all three live callers become thin glue, with no change to which schedules are applied.