pub enum StaleReconciliation {
NonePresent,
Collision(PidRecord),
DeadIncarnation(PidRecord),
ReusedPid(PidRecord),
LiveIncarnationElsewhere(PidRecord),
SucceededDrainer(PidRecord),
Unreadable {
reason: String,
},
}Expand description
What the birth claim found already sitting at the pid-file path, reconciled before the new record was written. Reported to the operator through the boot log; returned so tests can assert the reconciliation happened rather than trusting the log.
One face is not a reconciliation at all: Collision
is what the birth claim converts into a refusal
(HomeAlreadyClaimed). It lives in
this enum because it is one of the answers “what is already here?” has,
and keeping it out would have meant a second classification pass.
Variants§
NonePresent
No file was present: the ordinary boot.
Collision(PidRecord)
A file was present, its pid is alive, the incarnation MATCHES, it is BOOTING or SERVING, and its doors collide with the ones this boot intends to open. Nothing is written and the boot is REFUSED: at birth no bind has happened, so there is no bind-success argument to overrule a live record with, and starting anyway is exactly the invisible stacking the birth claim exists to prevent.
DeadIncarnation(PidRecord)
A file was present but its process is gone — the previous server died
without removing its record (crash, SIGKILL). The record is replaced.
ReusedPid(PidRecord)
A file was present and its pid is alive, but the live process’s start instant does not match the record — the pid was reused by something else after the recorded server died. The record is replaced; the stranger keeps running untouched.
LiveIncarnationElsewhere(PidRecord)
A file was present, its pid is alive, the incarnation MATCHES — but it is recorded on DIFFERENT addresses from the ones this boot INTENDS to bind, so the two servers do not collide: that server may be serving its addresses right now, and this one is about to serve others. The claimant boots UNCLAIMED: the first claimant keeps the record and the control verbs, the new incarnation serves without them, and the warning names the consequence. Neither server’s record is ever destroyed by the other’s boot or exit.
SucceededDrainer(PidRecord)
A file was present, its pid is alive, the incarnation MATCHES, and it is DRAINING: the recorded server has seen its termination signal and is on its way out. This boot SUCCEEDS it — the record is replaced with the successor’s, and the handover is logged naming both incarnations. The drainer’s own guard leaves the successor’s record alone at exit (its compare is by incarnation identity, which no longer matches).
Unreadable
A file was present but could not be parsed as a PidRecord (a
hand-written pid from the pre-verb ritual, or corruption). Replaced.
Trait Implementations§
Source§impl Clone for StaleReconciliation
impl Clone for StaleReconciliation
Source§fn clone(&self) -> StaleReconciliation
fn clone(&self) -> StaleReconciliation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StaleReconciliation
impl Debug for StaleReconciliation
impl Eq for StaleReconciliation
Source§impl PartialEq for StaleReconciliation
impl PartialEq for StaleReconciliation
impl StructuralPartialEq for StaleReconciliation
Auto Trait Implementations§
impl Freeze for StaleReconciliation
impl RefUnwindSafe for StaleReconciliation
impl Send for StaleReconciliation
impl Sync for StaleReconciliation
impl Unpin for StaleReconciliation
impl UnsafeUnpin for StaleReconciliation
impl UnwindSafe for StaleReconciliation
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request