job_queue: delete the cancelled-power-op intent revert
The revert hook is dead by construction, so it can only ever be wrong. DAG state `Cancelled` has exactly one producer: `JobQueue::cancel`, which refuses unless every work node is still `Pending`. A cancel *cascade* (some node failed, downstream cancelled) rolls up `Failed` instead — `dag_rollup` short-circuits on any failed subtree node. So on a DAG that reaches `Cancelled`, no node ever executed: the `SetWanted` head provably never ran and `wanted` still reads whatever the operator last set it to. There is therefore nothing to revert, and `revert_intent` did not revert anything — it wrote `Wanted::from_running(observed)`, i.e. the agent's *observed* state, over an intent the DAG never touched. Harmless when observed already matched, silent corruption otherwise: cancel a queued start for an agent that is down but `wanted = Up` (crashed, or caught mid-bounce) and the intent flips to `Offline`, leaving it deliberately-stopped as far as reconcile and crash-watch are concerned. The hook made sense when `set_wanted` was a pre-submit side effect written before the DAG ran; moving it into the DAG as a node left the hook vestigial. Drop `HookKind::RevertIntent`, `revert_intent`, and the power-op arm of `terminal_hook` — start / stop / graceful-stop now settle with no terminal hook, same as restart always did. The test asserts the general statement across restart/stop/start x graceful x running: stop and start carry a `SetWanted` head, and cancelling them still fires no hook.
This commit is contained in:
parent
7589f4c06c
commit
5c4a637941
4 changed files with 64 additions and 79 deletions
|
|
@ -10,10 +10,10 @@
|
|||
//! held, so it appears when the agent's owner node starts and disappears when
|
||||
//! its subgraph settles — one pill per agent a DAG touches.
|
||||
//!
|
||||
//! Per-DAG terminal work (approval resolution, `Rebuilt`, cancelled-power-op
|
||||
//! intent revert) is not drained here: it runs as the DAG's focused terminal
|
||||
//! node (`ResolveApproval` / `EmitRebuilt` / `RevertIntent`), dispatched through
|
||||
//! `exec::run_node` like any other node once the DAG settles.
|
||||
//! Per-DAG terminal work (approval resolution, `Rebuilt`) is not drained here:
|
||||
//! it runs as the DAG's focused terminal node (`ResolveApproval` /
|
||||
//! `EmitRebuilt`), dispatched through `exec::run_node` like any other node once
|
||||
//! the DAG settles.
|
||||
//!
|
||||
//! In-DAG growth (a `MetaLock` growing rebuild subgraphs, a `Reconcile` fanning
|
||||
//! its `Start`/`Stop`) flows through `NodeOutput.append_subgraph`, applied
|
||||
|
|
|
|||
Loading…
Reference in a new issue