Skip to main content

PoolError

Enum PoolError 

Source
pub enum PoolError {
    Crashed {
        status: Option<ExitStatus>,
        cause: CrashCause,
    },
    Timeout {
        timeout: Duration,
    },
    Protocol(Cow<'static, str>),
    Runtime(MontyException),
    Typing(String),
    Exhausted,
    Spawn(String),
    Finished,
    Disconnected {
        context: String,
    },
    Shutdown {
        dump: Option<Vec<u8>>,
    },
}
Expand description

Why a pool operation failed.

Variants§

§

Crashed

The worker is gone: it died (segfault, abort, external kill, or EOF on its pipes), or it announced a FatalError and exited — which a serving relay also uses to report that it could not start a worker at all. The worker has been discarded; the pool stays usable.

Fields

§status: Option<ExitStatus>

Exit status, when the process could be reaped.

§cause: CrashCause

How the pool learned of the death, and what it can say about it.

§

Timeout

The worker was killed after its turn outlived request_timeout (or one of the feed/turn duration backstop deadlines).

Fields

§timeout: Duration

The configured timeout that expired.

§

Protocol(Cow<'static, str>)

The worker violated the wire protocol, or the caller violated the checkout state machine. Worker-originated protocol failures discard the worker; caller misuse leaves it intact — except a turn cancelled mid-flight, where the abandoned worker is discarded too.

§

Runtime(MontyException)

The sandboxed code raised a Python exception. The worker and its session remain alive and usable — except for the one MemoryError a worker exceeding its memory limit produces, where the worker is already dead and the checkout finished (its distinct message distinguishes it from the interpreter’s own MemoryError).

§

Typing(String)

Type checking rejected the fed snippet (sessions created with type_check). The worker and session remain alive; the snippet did not run.

§

Exhausted

No worker became available within checkout_timeout.

§

Spawn(String)

A worker process could not be spawned.

§

Finished

The checkout was already finished or its worker already discarded.

§

Disconnected

The remote worker’s connection dropped without a turn-ending event (WebSocket transport only — the local analogue is Self::Crashed). The sandbox may have died, or the server may have dropped the session by policy (idle/session/turn timeout, capacity); the two are indistinguishable to a client that only learns of the close, so this deliberately says no more than “the connection went away”.

Fields

§context: String

What the pool was doing when the disconnect was observed.

§

Shutdown

The remote server is shutting down and did not run the request — re-running it on a fresh session is safe. dump restores the session via Checkout::restore on a fresh checkout: the session’s ID from a relay that stores sessions, returned only when PoolConfig::auto_resume could not resume it.

Fields

§dump: Option<Vec<u8>>

What restores the session; absent when there is nothing to load — no session yet, an ephemeral one, a relay without storage, or a park that failed.

Trait Implementations§

Source§

impl Debug for PoolError

Source§

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

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

impl Display for PoolError

Source§

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

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

impl Error for PoolError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for PoolError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

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

Source§

fn vzip(self) -> V