Skip to main content

DeathNote

Struct DeathNote 

Source
pub struct DeathNote { /* private fields */ }
Expand description

The armed death note. Constructed by DeathNote::arm early in the server run loop; its Drop writes the DISARMED line, so any ordinary exit from the run scope — clean shutdown, error return, or a panic unwinding through it — closes the bracket on the record.

Implementations§

Source§

impl DeathNote

Source

pub fn arm(home: &Path) -> Result<Self, ServerError>

Arm the death note under the resolved Aion home: create <home>/logs/, open the note file append-only, write the ARMED line, install the panic hook, and start the signal watcher.

§Errors

Returns ServerError::DeathNote when a note is already armed in this process, when the logs directory or note file cannot be created, or when the signal watcher cannot be installed. Arming failures are fatal to boot by design: a server that cannot record its own death is exactly the server this module exists for.

Source

pub fn drain_owns_termination(&self)

Declare that the run loop’s graceful drain is now watching for a termination signal, so the watcher must only OBSERVE one.

🔴 Before this existed, the watcher observed SIGTERM/SIGINT from the instant the note was armed — which is the instant the home is claimed, minutes before the doors open on a large store. Registering a handler MASKS the default action, so during the whole boot a termination signal was caught, written down, and answered by nobody: the drain that “owns the response” was not listening yet. The process was un-terminable by SIGTERM for the length of its own recovery, and then went on to serve as though nothing had been asked of it. Measured 2026-08-26: aion server stop against a booting server reported still draining at patience against a server that was not draining, and the server came up serving thirty seconds later.

While this is false, a termination signal ABANDONS THE BOOT. That is the honest response: no listener is bound, no work has been accepted, and there is nothing whatsoever to drain — so the only thing a drain could add is delay. The exit is recorded first, and the record the process leaves behind is reconciled as a dead incarnation by the next boot and removed by aion server stop’s own bookkeeping.

Source

pub fn path(&self) -> &Path

Path of the note file, for the startup banner and operator docs.

Source

pub fn disarm(self, reason: &str)

Close the bracket explicitly with the run loop’s own account of how it ended. Consumes the note; the DISARMED line is written by Drop.

Source

pub fn record_outcome(&self, record: &OutcomeRecord)

Append the shutdown outcome record as an OUTCOME entry, written BEFORE disarm so aion server stop can read the drain’s full result after the process is gone (crate::control::outcome is the reader). The death note already owns the “what ended this process” seam; extending it with one entry kind keeps a single file and a single writer — no parallel outcome channel.

A record that cannot be serialized is reported and dropped: the shutdown must not fail over its own receipt, and the reader treats the record’s absence as a state it names honestly.

Trait Implementations§

Source§

impl Debug for DeathNote

Source§

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

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

impl Drop for DeathNote

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> Instrument for T

Source§

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

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

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> IntoMaybeUndefined<T> for T

Source§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
Source§

impl<T> IntoOption<T> for T

Source§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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, 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, <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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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