feat(autoupdate): sweep immediately on channel-binary change #97
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VS-75-immediate-autoupdate-on-channel-change"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
VS-74 shipped the scheduled auto-update sweep but only covered AC1's "on a schedule" half: a fresh channel binary was picked up on the next tick, up to one intervalsecs late. This wires the immediate-on-change trigger.
AgentBinaryRefresher::refresh_now now returns a RefreshOutcome (fetch report plus catalog_changed), computed by comparing the served id->hash fingerprint before vs after the hot-swap, so a no-op reload (same bytes) does not fire. AgentBinaryRefresherHandle carries a shared tokio Notify: every refresh site (boot periodic task, admin force-refresh, live settingsupdate rebuild) shares the one handle and calls notify_changed() on a changed refresh. A single listener spawned in vervain_web::start (agent_autoupdate::spawn_change_trigger) awaits the signal and runs run_sweep, which is unchanged and already re-checks enabled and applies batchsize, so the kill switch and pacing are honored. Notify coalesces, so a change coinciding with a scheduled tick collapses to at most one extra sweep.
Tests: catalog fingerprint detects content/add/removal changes and treats identical bytes as unchanged; the change trigger pushes to a behind agent on signal when enabled and is a no-op when the kill switch is off.
#VS-75