diff --git a/src/graph/executor.rs b/src/graph/executor.rs index 3b0e397..e441e21 100644 --- a/src/graph/executor.rs +++ b/src/graph/executor.rs @@ -22,6 +22,7 @@ use std::path::PathBuf; use std::sync::Arc; use std::time::{Duration, Instant}; use tokio::sync::Semaphore; +use tokio::task::{AbortHandle, JoinHandle}; /// Test-only hook invoked inside a frontier branch task right after its /// teammate identity is retired, with the super-step's registry and the @@ -473,12 +474,10 @@ fn provision_frontier_peers( (Some(registry), assignments) } -/// Aborts every owned task when dropped. Aborting a task that has already -/// finished is a no-op, so the success path is unaffected. -pub(super) struct TaskCancelGuard(Vec); +pub(super) struct TaskCancelGuard(Vec); impl TaskCancelGuard { - pub(super) fn new(tasks: &[tokio::task::JoinHandle]) -> Self { + pub(super) fn new(tasks: &[JoinHandle]) -> Self { Self(tasks.iter().map(|task| task.abort_handle()).collect()) } diff --git a/src/graph/validator.rs b/src/graph/validator.rs index c3f98e0..cf61276 100644 --- a/src/graph/validator.rs +++ b/src/graph/validator.rs @@ -482,7 +482,7 @@ impl GraphValidator { node_id, format!( "Agent '{}' has both config.yaml and graph.yaml; a graph agent is \ - defined by graph.yaml alone — remove one of the two files", + defined by graph.yaml alone. Remove one of the two files", a.agent ), ));