Watch
0
0
Fork
You've already forked hyperhive
0

auto-update: a rebuild is live until its whole subtree is terminal

rebuild_live checked only MetaSync, which finishes in 0.2 s, so the next
5-min pass queued a second rebuild while the first still held the stop,
swap and start. It now covers MetaSync, AgentWindow, Prebuild,
StopForUpdate, Swap and RebuildBookkeeping. AgentWindow is also the brace
of a pause window, so an open pause skips that agent's pass too; the docs
say so and a test pins it.
This commit is contained in:
atlas 2026-11-19 00:48:25 +01:00 • committed by mara
commit 12e797e7e3

View file

@ -188,13 +188,13 @@ impl JobQueue {
Ok(named)
}
/// Whether a rebuild of `agent` is queued or running: its `MetaSync` is not
/// terminal yet.
/// Whether a rebuild of `agent` (or a pause window for it) is queued or
/// running: any node matching [`model::NodeKind::is_rebuild_step`] is not
/// terminal yet. The tail `Reconcile` is outside that set.
#[must_use]
pub fn rebuild_live(&self, agent: &str) -> bool {
self.lock().graph().nodes().any(|n| {
!n.state.is_terminal()
&& matches!(&n.payload, model::NodeKind::MetaSync { agent: a } if a == agent)
!n.state.is_terminal() && n.payload.is_rebuild_step() && n.payload.agent() == agent
})
}