pub struct ShutdownHandle { /* private fields */ }Expand description
Handle to trigger graceful shutdown of the node.
Implementations§
Source§impl ShutdownHandle
impl ShutdownHandle
Sourcepub async fn shutdown(&self)
pub async fn shutdown(&self)
Trigger a graceful shutdown of the node.
Three-phase shutdown — order matters:
- Close admission: flip
OpManager::shutting_downsostart_client_{put,get,update,subscribe}immediately refuse new work withOpError::NodeShuttingDown. Without this, a new client op could spawn between the drain observingcounter == 0and Disconnect being sent — that op would bump the counter (now unobserved) and then get cut off by the Disconnect. (Codex reviewer call-out 2026-05.) - Drain: wait up to
drain_timeoutfor the in-flight client-op counter to reach zero. Without this wait, a SIGTERM arriving mid-PUT (e.g. release-driven auto-update on the nova gateway) drops the client’s WebSocket mid-operation. See the rationale onConfig::shutdown_drain_secs. - Disconnect: send
NodeEvent::Disconnect, which closes peer connections and exits the event loop.
Scope limitation: the drain covers client-originated
drivers only. In-flight relay operations (peer-to-peer
PUT/GET this node is forwarding) are NOT drained — those are
short-lived per-message work and the peer can re-attempt. The
targeted failure mode is user-facing WS client requests (the
freenet-git mirror), not relay traffic.
Trait Implementations§
Source§impl Clone for ShutdownHandle
impl Clone for ShutdownHandle
Source§fn clone(&self) -> ShutdownHandle
fn clone(&self) -> ShutdownHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShutdownHandle
impl RefUnwindSafe for ShutdownHandle
impl Send for ShutdownHandle
impl Sync for ShutdownHandle
impl Unpin for ShutdownHandle
impl UnsafeUnpin for ShutdownHandle
impl UnwindSafe for ShutdownHandle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more