refactor(#2591): fix wire-shape consumers (server await_dags, tests)
- server::await_dags: a DAG is settled when gone from the snapshot (fully Done) or present with all nodes terminal; pending only with a non-terminal node (DagView no longer carries a rolled-up state). - DagView::rollup_state() added to hive-sh4re — the shared node-set roll-up derivation every Rust consumer uses. - JobQueue::build_log_id_of(node_id) — the node_id -> build_logs lookup the query endpoint will use; tests assert log-id via it now. - tests: derive roll-up state; drop the off-wire step/build_log_id wire asserts.
This commit is contained in:
parent
c574948d7c
commit
51bcad1adb
4 changed files with 69 additions and 13 deletions
|
|
@ -795,9 +795,14 @@ async fn await_dags(coord: &Arc<Coordinator>, ids: &[u64], timeout: std::time::D
|
|||
let deadline = std::time::Instant::now() + timeout;
|
||||
loop {
|
||||
let snap = coord.job_queue.snapshot();
|
||||
let pending = ids
|
||||
.iter()
|
||||
.any(|id| snap.iter().any(|d| d.id == *id && !d.state.is_terminal()));
|
||||
// A DAG has settled when it's either gone from the snapshot (fully
|
||||
// `Done` DAGs drop out) or still present but with every node terminal
|
||||
// (a `Failed`/`Cancelled` DAG lingers). It's pending only while it has
|
||||
// a non-terminal node.
|
||||
let pending = ids.iter().any(|id| {
|
||||
snap.iter()
|
||||
.any(|d| d.id == *id && d.nodes.iter().any(|n| !n.state.is_terminal()))
|
||||
});
|
||||
if !pending {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue