Skip to main content

ResumeState

Enum ResumeState 

Source
pub(super) enum ResumeState {
    NotTracking {
        current_generation: u64,
    },
    AwaitingOutcome {
        generation: u64,
        attempted_sid: String,
        retry: RetryPayload,
        held_error_line: Option<String>,
        stop_requested: bool,
    },
    ConfirmedRetry {
        generation: u64,
        attempted_sid: String,
        retry: RetryPayload,
        held_error_line: Option<String>,
        stop_requested: bool,
    },
}
Expand description

One spawn attempt’s resume/error-line lifecycle.

Variants§

§

NotTracking

No --resume attempt is in flight for the current generation — either this spawn never attached --resume, or a prior attempt already resolved (session id captured, retry fired, or exited with an unrelated error). current_generation is whichever generation this resolved FROM (or 0 if no spawn has ever happened — see Default below). reagentx P1 (round 5 on PR #2373): without this, NotTracking couldn’t tell a legitimate ProcessExited for the generation that just resolved apart from a STALE one for an already-superseded older generation, letting the older one incorrectly publish terminal status over a newer, actively-running generation. See ProcessExited’s handling below.

Fields

§current_generation: u64
§

AwaitingOutcome

--resume <attempted_sid> was attached at spawn; outcome not yet known. held_error_line is Some once a terminal result/is_error:true stdout line has arrived but its persistence is still undecided. stop_requested records an explicit user Stop that must override a retry even if one gets confirmed later.

Fields

§generation: u64
§attempted_sid: String
§held_error_line: Option<String>
§stop_requested: bool
§

ConfirmedRetry

The stderr reader confirmed attempted_sid unreachable under the current config dir — the retry WILL fire the moment the process actually exits, unless stop_requested overrides it.

reagentx P1 (round 9 on this PR, also flagged inline by codex): attempted_sid is carried forward from AwaitingOutcome (not dropped at promotion) so SessionCaptured can still tell an ambiguous same-sid echo apart from unambiguous progress even after confirmation — see that arm’s own doc comment for why treating EVERY capture as unambiguous once confirmed was wrong: resume_poisoned (persistent/mod.rs) is a single, non-generation- scoped, permanent field, so a lagging stderr-reader task from an OLDER, already-superseded generation can overwrite it to a different sid while THIS generation is still ConfirmedRetry, silently disabling try_capture_session_id’s poison guard for this generation’s own attempted sid and letting a routine same-sid echo reach this arm.

Fields

§generation: u64
§attempted_sid: String
§held_error_line: Option<String>
§stop_requested: bool

Implementations§

Source§

impl ResumeState

Source

pub(super) fn is_seeded_message( &self, generation: u64, delivered_seq: u64, ) -> bool

Read-only accessor for the drain: is delivered_seq the exact message spawn_process originally seeded the retry batch with (its first entry), for the given generation? Used to identify the already-recorded seed before appending any LATER message the drain delivers. Matched by queue identity (QueuedRetryEntry::seq), neither by position (see PersistentSubprocessController::drain_queue_after_successful_spawn’s own doc comment for why the front of the queue isn’t necessarily the seed) nor by content (issue #2365 — a later, genuinely different delivery sharing identical text must not be mistaken for the seed).

Trait Implementations§

Source§

impl Clone for ResumeState

Source§

fn clone(&self) -> ResumeState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResumeState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ResumeState

Source§

fn default() -> Self

current_generation: 0 — real generations start at 1 (PersistentInner::spawn_generation is bumped before its first use), so this default can never accidentally match a genuine ProcessExited event.

Source§

impl PartialEq for ResumeState

Source§

fn eq(&self, other: &ResumeState) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResumeState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more