Skip to main content

AuditBatchConfig

Struct AuditBatchConfig 

Source
pub struct AuditBatchConfig {
    pub max_pending_rows: NonZeroUsize,
    pub max_rows_per_generation: NonZeroUsize,
    pub max_commit_attempts: NonZeroU8,
    pub retry_backoff: Duration,
    pub admission_deadline: Duration,
    pub resolution_deadline: Duration,
    pub max_abandoned_appends: NonZeroUsize,
}
Expand description

Tunables for the batch seam. Defaults are conservative; every field is exercised by at least one mechanism test.

Fields§

§max_pending_rows: NonZeroUsize§max_rows_per_generation: NonZeroUsize§max_commit_attempts: NonZeroU8§retry_backoff: Duration§admission_deadline: Duration§resolution_deadline: Duration

Caps how much longer AuditBatch::submit_until_resolved keeps waiting on a row’s real generation outcome once admission_deadline has already elapsed on it. Without this bound a generation stuck on a stalled EventStore::append_events_idempotent call retains the completed write’s caller, its request slot, and its audit-lane waiter forever, exhausting both request and audit capacity (khive#2331). Must be at least admission_deadline — validated (debug-only) in AuditBatch::new. Defaults to 6x admission_deadline.

Also the single source value the driver’s own per-generation append bound (supervisor_loop’s driver_append_deadline) is derived from — that bound exists so a stalled append cannot keep the driver from ever draining pending again, which is what actually exhausts admission for every later caller, not just the one already waiting on the stuck row. See AuditTerminalReason::DriverAppendAbandoned.

§max_abandoned_appends: NonZeroUsize

Caps how many AuditTerminalReason::DriverAppendAbandoned appends may be outstanding (handed to a detached task, still running) at once. Each outstanding append retains up to max_rows_per_generation events until it finally returns, so the retained-buffer bound this places on a wedged store is max_abandoned_appends * max_rows_per_generation rows — without it, a store whose append never returns mints one such task per driver_append_deadline with no cap, and both the live task count and the retained event batches inside them grow until the process exits (khive#2331). Once the cap is reached, supervisor_loop sheds further generations with AuditTerminalReason::StoreWedged instead of attempting another append; it resumes attempting appends as soon as an outstanding one returns and the count drops back below the cap. Defaults to 4.

Trait Implementations§

Source§

impl Clone for AuditBatchConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AuditBatchConfig

Source§

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

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

impl Default for AuditBatchConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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