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: CrashCauseHow 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).
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”.
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.
Trait Implementations§
Source§impl Error for PoolError
impl Error for PoolError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()