hyperhive/swarm-controller/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas b8c5840299 swarm-controller: retry hive provisioning until the store is up
The read policy and cert-auth role for each hive were written once, at
startup. On the deploy that surfaced this, the store was still coming
up, the pass logged its warning and moved on, and no hive could log in
until someone restarted the daemon — while cert auth answered "no chain
matching all constraints", which reads like a certificate problem
rather than a role that was never created.

The bootstrap unit in swarm-bao.nix lost the same race and won on its
retry 30s later. A daemon that boots alongside its store loses that race
routinely; on a normal boot it is the ordinary case.

The two passes fold into one `provision()` that logs in once instead of
twice for two loops over the same list, keeping policy before role since
the role names the policy. `ensure_hive_access` still awaits the first
pass, so a store that is already up leaves nothing deferred, and only a
pass that could not reach the store at all spawns the retry.

The retry is `config_pr::spawn`'s idiom from this same crate: an
interval task whose first tick is immediate. Its cadence and bound match
the bootstrap unit's — 30s, ~a day — because the two halves of one race
should not disagree about how long a wait is worth.

`Error::MissingEnv` is what keeps it from spinning forever: no `BAO_*`
set means a deployment that runs no store, where asking again changes
nothing, so it returns Ok. Everything else is retryable, including an
authority file that is not placed yet — the unit that writes it starts
alongside this one. Both cases previously landed in the same "not
managed here" line, so a store that was late looked exactly like one
that was never configured.

Per-hive failures keep their old behaviour: logged, skipped, Ok. A store
that refuses one hive's write refuses it again, so the next start really
is the right retry for those, and the module doc still says so.

Closes #4176.
2026-09-11 09:03:30 +02:00
..
agent_status.rs swarm-ui: add agent start/stop, backed by the wanted-state route 2026-09-02 19:57:04 +02:00
auth.rs swarm-queue-client: audience-scoped tokens + a blocking mint for a non-reactor caller 2026-08-29 11:17:24 +02:00
config_pr.rs swarm-controller: fix stale route reference in snapshot's doc comment 2026-08-19 22:27:12 +02:00
forge.rs swarm-controller+swarm-ui: merge config-PR into GET /api/agents/status 2026-09-02 14:18:02 +02:00
issue_report.rs swarm-controller: fix broken intra-doc link in issue_report.rs 2026-08-31 18:50:38 +02:00
main.rs swarm-controller: retry hive provisioning until the store is up 2026-09-11 09:03:30 +02:00
matrix_account.rs swarm-controller: keep a hive's read grant in step with its declaration 2026-09-09 18:40:41 +02:00
otel_http_client.rs move otel_http_client from swarm-queue-client into swarm-controller 2026-08-29 11:17:24 +02:00
read_policy.rs swarm-controller: retry hive provisioning until the store is up 2026-09-11 09:03:30 +02:00
status.rs swarm-controller: make status::render/row pub(crate) so agent_status.rs's doc links resolve 2026-09-02 10:20:29 +02:00
store.rs swarm-controller: keep a hive's read grant in step with its declaration 2026-09-09 18:40:41 +02:00
vcs_metrics.rs docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
wanted.rs swarm: add a declared "paused" agent wanted state 2026-09-11 01:35:40 +02:00
webhook.rs swarm-controller: emit vcs commit/push otel counters from an instance-wide forge webhook 2026-08-24 20:54:49 +02:00