ChaosConfiguration

Struct ChaosConfiguration 

Source
pub struct ChaosConfiguration {
Show 20 fields pub clog_probability: f64, pub clog_duration: Range<Duration>, pub partition_probability: f64, pub partition_duration: Range<Duration>, pub bit_flip_probability: f64, pub bit_flip_min_bits: u32, pub bit_flip_max_bits: u32, pub bit_flip_cooldown: Duration, pub partial_write_max_bytes: usize, pub random_close_probability: f64, pub random_close_cooldown: Duration, pub random_close_explicit_ratio: f64, pub packet_loss_probability: f64, pub clock_drift_enabled: bool, pub clock_drift_max: Duration, pub buggified_delay_enabled: bool, pub buggified_delay_max: Duration, pub buggified_delay_probability: f64, pub connect_failure_mode: ConnectFailureMode, pub connect_failure_probability: f64,
}
Expand description

Configuration for chaos injection in simulations.

This struct contains all settings related to fault injection and chaos testing, following FoundationDB’s BUGGIFY patterns for deterministic testing.

Fields§

§clog_probability: f64

Clogging probability for individual writes (0.0 - 1.0)

§clog_duration: Range<Duration>

Duration range for clog delays

§partition_probability: f64

Network partition probability (0.0 - 1.0)

§partition_duration: Range<Duration>

Duration range for network partitions

§bit_flip_probability: f64

Bit flip probability for packet corruption (0.0 - 1.0)

§bit_flip_min_bits: u32

Minimum number of bits to flip (power-law distribution lower bound)

§bit_flip_max_bits: u32

Maximum number of bits to flip (power-law distribution upper bound)

§bit_flip_cooldown: Duration

Cooldown duration after bit flip to prevent excessive corruption

§partial_write_max_bytes: usize

Maximum bytes for partial write simulation (BUGGIFY truncates writes to 0-max_bytes) Following FDB’s approach of truncating writes to test TCP backpressure handling

§random_close_probability: f64

Random connection close probability per I/O operation (0.0 - 1.0) FDB default: 0.00001 (0.001%) - see sim2.actor.cpp:584

§random_close_cooldown: Duration

Cooldown duration after a random close event (prevents cascading failures) FDB uses connectionFailuresDisableDuration - see sim2.actor.cpp:583

§random_close_explicit_ratio: f64

Ratio of explicit exceptions vs silent failures (0.0 - 1.0) FDB default: 0.3 (30% explicit) - see sim2.actor.cpp:602

§packet_loss_probability: f64

Packet loss probability (0.0 - 1.0) When non-zero, poll_write succeeds but data is probabilistically dropped and never delivered, simulating unreliable networks. Higher-level protocols must rely on timeouts to detect this.

§clock_drift_enabled: bool

Enable clock drift simulation When enabled, timer() can return a time up to clock_drift_max ahead of now() FDB ref: sim2.actor.cpp:1058-1064

§clock_drift_max: Duration

Maximum clock drift (default 100ms per FDB) timer() can be up to this much ahead of now()

§buggified_delay_enabled: bool

Enable buggified delays on sleep/timer operations When enabled, 25% of sleep operations get extra delay FDB ref: sim2.actor.cpp:1100-1105

§buggified_delay_max: Duration

Maximum additional delay for buggified sleep (default 100ms) Uses power-law distribution: max_delay * pow(random01(), 1000.0) FDB ref: sim2.actor.cpp:1104

§buggified_delay_probability: f64

Probability of adding buggified delay (default 25% per FDB)

§connect_failure_mode: ConnectFailureMode

Connection establishment failure mode (per FDB) FDB ref: sim2.actor.cpp:1243-1250 (SIM_CONNECT_ERROR_MODE)

§connect_failure_probability: f64

Probability of connect failure when Probabilistic mode is enabled (default 50%)

Implementations§

Source§

impl ChaosConfiguration

Source

pub fn disabled() -> Self

Create a configuration with all chaos disabled (for fast local testing)

Source

pub fn random_for_seed() -> Self

Create a randomized chaos configuration for seed-based testing

Trait Implementations§

Source§

impl Clone for ChaosConfiguration

Source§

fn clone(&self) -> ChaosConfiguration

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ChaosConfiguration

Source§

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

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

impl Default for ChaosConfiguration

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

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
§

impl<T> From<T> for T

§

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
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

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

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

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

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