pub struct CascadeDetector { /* private fields */ }Expand description
Tracks failure propagation across DAG regions for cascade-aware routing.
A “region” is the set of tasks reachable from the “heaviest root” of each task — the root ancestor that is the source of the most downstream tasks. For tasks with multiple roots (diamond patterns), we pick the single root that covers the most descendants, preventing over-aggressive deprioritisation (C8 fix).
Implementations§
Source§impl CascadeDetector
impl CascadeDetector
Sourcepub fn new(config: CascadeConfig) -> CascadeDetector
pub fn new(config: CascadeConfig) -> CascadeDetector
Create a new detector.
Sourcepub fn record_outcome(
&mut self,
task_id: TaskId,
succeeded: bool,
graph: &TaskGraph,
)
pub fn record_outcome( &mut self, task_id: TaskId, succeeded: bool, graph: &TaskGraph, )
Record a task outcome and update the health of its primary region.
Sourcepub fn is_cascading(&self, task_id: TaskId, graph: &TaskGraph) -> bool
pub fn is_cascading(&self, task_id: TaskId, graph: &TaskGraph) -> bool
Returns true when the primary region of task_id is in cascade failure.
Sourcepub fn deprioritized_tasks(&self, graph: &TaskGraph) -> HashSet<TaskId>
pub fn deprioritized_tasks(&self, graph: &TaskGraph) -> HashSet<TaskId>
Returns the set of task IDs that should be deprioritized due to cascade failure.
Returns an empty set when no region is cascading, avoiding unnecessary reordering.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CascadeDetector
impl RefUnwindSafe for CascadeDetector
impl Send for CascadeDetector
impl Sync for CascadeDetector
impl Unpin for CascadeDetector
impl UnsafeUnpin for CascadeDetector
impl UnwindSafe for CascadeDetector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request