Module manifest_poll

Module manifest_poll 

Source
Expand description

Periodic agent-side manifest poll. Mirrors CP’s runtime::workers::manifest_poll: every 30s the worker fetches /v1/fleet.resolved + each channel’s /v1/rollouts/{id} from CP, verifies signatures + cross-checks each rollout’s fleet_resolved_hash against the canonical hash of the just-fetched fleet, then emits ReducerInput::ManifestSetUpdated so the reducer’s cached SignedManifestSet reflects the current fleet snapshot.

First tick fires at Instant::now() (no startup delay), so the reducer’s manifests cache is populated before the longpoll worker receives its first Dispatch. Subsequent ticks every 30s; on tick failure the worker retains the prior emit and retries next tick.

Failure semantics (matching CP’s manifest_poll):

  • Fleet fetch/verify failed -> skip the entire tick; reducer retains its prior cache.
  • Per-rollout fetch/verify failed OR cross-check mismatch -> log + skip that channel only; emit the partial set.
  • Reducer channel closed (cancel propagated) -> exit.

Constants§

POLL_INTERVAL 🔒
Poll cadence. Matches CP’s runtime::workers::manifest_poll::POLL_INTERVAL.

Functions§

spawn
spawn_with_trust_path
Tunable-trust-path entry point. Production code calls spawn which threads AgentConfig::trust_file (the --trust-file CLI arg); integration tests under the test-helpers feature gate call this variant with a tempdir-rooted trust.json so the worker can run without touching /etc/nixfleet/agent/. Same convention as nixfleet_agent::runtime::ShutdownToken::__test_only_from_rx.
tick_once 🔒