apollo_config_manager: retry a dynamic config dispatch the component rejected - #14926
Conversation
PR SummaryMedium Risk Overview
Failed dispatches now increment Reviewed by Cursor Bugbot for commit 5f764e4. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
Reviewed with an independent adversarial pass. Verdict: no high-severity findings; the retry path was mutation-tested (reverting only Applied two of the findings in this push:
Two notes for reviewers, neither applied: Log volume on a permanently-rejected config. Because
On the design trade-off itself: retrying forever with a firing p2 is clearly better than the old silent drop. The component rejects before writing, so there is no state thrash, and the alert now stays up exactly as long as the problem does. |
08d1f3c to
5d25a93
Compare
itamar-starkware
left a comment
There was a problem hiding this comment.
@itamar-starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on matanl-starkware).
…rejected update_config advanced latest_node_dynamic_config before awaiting set_node_dynamic_config. When the dispatch failed, two things went wrong at once: latest_ already held the new value, so every later tick took the "no change" early return and never retried, leaving the node on the old config while the runner believed the new one had been applied; and unlike the load and validate paths, this one did not increment CONFIG_MANAGER_UPDATE_ERRORS, so config_manager_update_error_increase never fired and the drop was silent. Record the config only once the component accepts it, so the next update retries naturally, and count the failure so a persistent one alerts. Fixes #14925. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5d25a93 to
5f764e4
Compare
matanl-starkware
left a comment
There was a problem hiding this comment.
@matanl-starkware reviewed 3 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on matanl-starkware).
|
Security scan complete — no issues detected. Generated by Claude Code |
Fixes #14925. Independent of #14924 — branched from
main, touches only the dispatch branch ofupdate_config.Problem
update_configadvancedlatest_node_dynamic_configbefore awaitingset_node_dynamic_config:When the dispatch failed, two things went wrong together:
latest_already held the new value, so every later tick took thelatest == newearly return and did nothing. The node kept running the old config indefinitely, while the runner behaved as though the new one had been applied.CONFIG_MANAGER_UPDATE_ERRORS, soconfig_manager_update_error_increasecould not fire. The dropped update was completely silent.This is the one path where a config change can be lost with no signal.
set_node_dynamic_configcan legitimately fail — the receiving component validates the dynamic config, and it is a channel-based call that can error under load.Change
Record the config only once the component has accepted it, and count the failure:
latest_node_dynamic_configis assigned inside theOkarm. Leaving it untouched on failure means the next 20s tick sees a difference and retries by itself.Errarm incrementsCONFIG_MANAGER_UPDATE_ERRORSand logs, so a persistent failure surfaces through the existing alert instead of going quiet. A single transient rejection self-heals on the next tick.Tests
failed_dispatch_is_retried_on_the_next_update— a client that always rejects must be called twice across twoupdate_configcalls. Verified this fails on the old ordering (mockall reports the second dispatch never happens).accepted_dispatch_is_not_repeated_while_the_config_is_unchanged— the counterpart, pinning that a successful dispatch is still recorded, so an unchanged file is not re-dispatched every tick.cargo test -p apollo_config_manager— 17 passed.scripts/rust_fmt.sh --checkand clippy clean.Scope
Found while reviewing #14924 but present on
mainwell before it; kept separate so an unrelated pre-existing bug does not ride along on that PR.🤖 Generated with Claude Code