Expand description
Crash simulation for testing recovery. The injector is enabled by the
fault-injection feature.
A FaultInjector armed at a FaultPoint stops the runtime there:
Fault::Crashpanics inside the runtime’s task. Nothing after the point runs: no further writes, no lease release, no heartbeat. The caller gets aRuntimeError::Internal, and a new runtime over the same store plays the restarted process.Fault::Abortcallsstd::process::abort, killing the process at that exact point, for tests that run the runtime in a subprocess.
An action already spawned when the crash hits keeps running, like a request already on the wire.
ⓘ
let injector = Arc::new(FaultInjector::new().at(FaultPoint::AfterActionReturned).crash());
let runtime = Runtime::builder(store).fault_injector(Arc::clone(&injector)).build();Structs§
- Arming
- A point being armed; finish with
Arming::crashorArming::abort. - Fault
Injector - Stops the runtime at chosen points. Each armed fault fires once.
Enums§
- Fault
- What happens at an armed point.
- Fault
Point - Where in an effect’s execution a crash can be injected, in the order they are reached.