Skip to main content

ErrorGraph

Struct ErrorGraph 

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

Every failure the device is still holding, and how many allocations carry each one.

Implementations§

Source§

impl ErrorGraph

Source

pub const MAX_SKIPPED: usize = 16

How many Skipped records one failure keeps. Newest win: the walk a read makes starts from the most recent buffers, so keeping the oldest would leave them with no entry to start from, while a deep chain reaching a gap before the root costs nothing — the root is on the node itself and never in the list.

Source

pub fn insert(&mut self, error: ServerError) -> FailureId

Hold error until nothing carries its id any more.

The node starts carried by nothing, so a caller that taints no slice with it must hand it back through prune — otherwise the node waits forever for a decrement that is never coming.

Source

pub fn skipped(&mut self, failure: FailureId, record: Skipped)

Record a launch failure stopped — see Skipped. Keeps the newest MAX_SKIPPED records and counts them all.

Source

pub fn report( &self, failure: FailureId, memory: ManagedMemoryId, ) -> Option<ServerError>

The report a read of memory gets when failure claims its bytes: the root error, and the path from this buffer back toward it, reconstructed by walking the skip records backwards.

Source

pub fn reports( &self, claims: impl Iterator<Item = Claim>, ) -> Result<(), ServerError>

The report a read owes for the claims it found: one error per distinct failure, however many of the buffers carry it, and one per buffer that was never allocated. The second kind is not in the graph, since nothing could carry it, but it is the same answer to the same question.

This is the shape of every “were these bytes written” answer in the system — FailureStore::ensure_written and any harness standing in for it — so the dedup and the wrapping live here rather than once per caller.

§Errors

ServerError::Several naming each failure once, in the order the claims were found. The caller has nothing to retry — the bytes are gone — so this is the answer to the read, not a hint to try again.

Source

pub fn untag(&mut self, failure: Option<FailureId>)

One fewer allocation carries failure; the node is dropped when none does.

This is what every shedding path calls — a slice written again, rebound to a new allocation, coalesced away, tombstoned or swept — and the decrement is immediate rather than collected into a list drained later, so a node nothing can reach is never retained just because nothing got around to saying so.

Source

pub fn replace(&mut self, failure: FailureId, error: ServerError)

Swap the error behind failure for error, leaving every carrier pointing at the new one.

This is the exit half of a write scope: entry taints the write set with a provisional node, because the real failure does not exist yet, and exit lands the real one here. A missing node is left missing — the id outlived its carriers, so nothing can read the error either way.

Source

pub fn prune(&mut self, failure: FailureId)

Drop failure if nothing took its id — for a failure that turned out to taint nothing, whose node would otherwise wait forever at zero.

Source

pub fn error(&self, failure: FailureId) -> Option<&ServerError>

The error behind failure.

None means the id outlived its node, which the refcount exists to prevent; a reader treats it as no failure rather than panicking on the device thread.

Source

pub fn len(&self) -> usize

How many failures the device is still holding — the bound the whole design rests on, which is why the property harness watches it.

Source

pub fn is_empty(&self) -> bool

Whether the device is holding no failure at all.

Trait Implementations§

Source§

impl Debug for ErrorGraph

Source§

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

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

impl Default for ErrorGraph

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Sync + Send>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

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

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
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, !>

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