topology: drop manager-root special case + notify three agents on reparent (#743)

This commit is contained in:
damocles 2026-05-31 13:23:00 +02:00 committed by Mara
commit 2c3b62be55
4 changed files with 139 additions and 20 deletions

View file

@ -187,13 +187,15 @@ async fn dispatch(req: &HostRequest, coord: Arc<Coordinator>) -> HostResponse {
}
HostRequest::SetParent { child, new_parent } => {
tracing::info!(%child, ?new_parent, "set_parent");
crate::topology::set_parent(child, new_parent.as_deref())
// `reparent_with_notify` wraps `topology::set_parent`
// with the three notification messages (#743) + the
// ContainerView rescan. Idempotent same-parent calls
// skip both the messages and the disk write per the
// topology fast-path.
coord
.reparent_with_notify(child, new_parent.as_deref())
.await
.map_err(anyhow::Error::msg)?;
// ContainerView.parent is read from topology.json — a
// change here means every container row potentially
// moves in the dashboard tree. Rescan + diff-emit so
// open viewers repaint without polling.
coord.rescan_containers_and_emit().await;
HostResponse::success()
}
})