pub struct ResilienceConfig {
pub on_upstream_error: FailMode,
pub on_internal_error: FailMode,
pub on_config_error: FailMode,
pub on_parser_limit: FailMode,
pub upstream_timeout_ms: u64,
}Expand description
Explicit, per-scenario failure policy. No single global boolean: each kind of trouble has its own correct posture (see the defaults’ rationale in §9).
Fields§
§on_upstream_error: FailModeOrigin unreachable / timeout. fail_closed → 502, fail_open → 503
(retryable). NB: fail_open here does NOT mean “let traffic through”
(there is no origin to reach) — only which 5xx is returned.
on_internal_error: FailModeModule panic / regex blow-up. fail_open → skip the module and continue
(a WAF bug must not take down the site); fail_closed → synthetic block.
on_config_error: FailModeInvalid config detected at runtime (hot reload, Pillar 3). fail_open →
keep last-good config; fail_closed → refuse serving until valid.
on_parser_limit: FailModeNormalization failed (limits exceeded / malformed input). fail_closed →
400; fail_open → forward UNINSPECTED (logged loudly).
upstream_timeout_ms: u64Hard cap on the upstream round-trip so a stalled origin cannot pin the worker. Must be >= 1 (validated).
Implementations§
Source§impl ResilienceConfig
impl ResilienceConfig
Sourcepub fn upstream_timeout(&self) -> Duration
pub fn upstream_timeout(&self) -> Duration
Upstream round-trip cap as a Duration.
Trait Implementations§
Source§impl Clone for ResilienceConfig
impl Clone for ResilienceConfig
Source§fn clone(&self) -> ResilienceConfig
fn clone(&self) -> ResilienceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more