Watch
0
0
Fork
You've already forked hyperhive
0

reconcile tick: create a placed agent whose deploy event was missed

The swarm's deploy event is core NATS. The wanted-state declaration lands
before the build, so its create fails on no record, and only the event
re-drives it; a hive that missed the event had nothing to retry.

wanted.rs now remembers which agents the last declaration places with a
container. Each tick, a placed agent with no container whose record says
the builder pushed its closure gets its first deploy through
JobQueue::insert_first_deploy_if_idle, which queues nothing while any node
targets the agent. Record reads and creates back off like restarts, in a
history of their own.
This commit is contained in:
atlas 2026-11-19 11:54:39 +01:00 • committed by mara
commit ad30b7ea31

View file

@ -352,6 +352,19 @@ the agent, `observed=stopped` (`harness stopped` for a running container), `want
`hyperhive.hive.reconcile_tick.restarts`. `crash_watch` keeps raising its
alert; the tick only converges.
The tick also creates a placed agent that has no container: one the swarm's
declaration wants up or paused on this hive (`wanted::placed`) and that
`nixos-container list` doesn't show. The swarm's deploy event normally queues
that create, but it travels over core NATS, so a hive can miss it. Once the
agent's record in `agent-closures` says the builder pushed its closure, the tick
queues the first deploy through `JobQueue::insert_first_deploy_if_idle`, which
queues nothing while any node targets the agent, and sets the agent's intent to
`Up` as the event does. A missing or unpushed build counts as an attempt, like a
queued create, so one agent's record reads and creates follow the restart
spacing, in a history of their own. Each create logs `reconcile tick: creating
placed agent`; each wait logs `reconcile tick: placed agent has no build to
create from yet` with the reason.
## Meta flake
Agents build from the swarm's `internal/meta` flake, which swarm-controller