Module probe

Module probe 

Source
Expand description

Probe worker (RFC-0007 §8). On each LocalResetProbeCache:

  1. Aborts every per-probe ticker spawned for the previous rollout (the JoinHandle::abort invariant: no probe ticker from rollout N runs after LocalResetProbeCache { rollout_id: N } is observed).
  2. Reads /etc/nixfleet/agent/health-checks.json (rendered by the host’s NixOS module from the mkFleet-resolved effective set — closure-driven, transitively signed via the closure hash chain per RFC-0007 §4). Path is hardcoded; no --health-checks-config flag.
  3. Emits one LocalProbeTopologyDeclared event into the reducer input MPSC, then spawns one ticker per probe with mode != "disabled".

Each ticker fires every intervalSeconds (or once, if runOnce = true). On each tick it dispatches to the kind-specific probe_runners::run and emits LocalProbeResult. The ticker holds its own first-observation + first-failure flags to drive the LocalProbeObservedFirst / LocalProbeFailureFirst events RFC-0005 §3.2 requires.

Test-mode escape hatch: NIXFLEET_AGENT_PROBE_TEST_MODE=1 skips reading the JSON file and the spawn loop — the smoke test sets it so the runtime can boot without a /etc/ file or actual probes.

Constants§

HEALTH_CHECKS_PATH 🔒

Functions§

abort_all 🔒
handle_reset 🔒
parse_mode 🔒
spawn
spawn_ticker 🔒