Expand description
Stores and evaluates per-server federation reachability.
Each failure is a blind write keyed by (server, bucket), with repeated
failures in one window deliberately coalescing; current row values retain
the classification and exact failure time. A scan derives the latest
anchor and surviving bucket span before applying the retry curve. Successful
outbound or inbound contact clears the server prefix. The bucket width
comes from sending.timeout, keeping this gate aligned with sender backoff.
Re-exportsΒ§
use std::collections::BTreeMap;πuse std::time::Duration;πuse std::time::SystemTime;πuse std::time::UNIX_EPOCH;πuse futures::Stream;πuse futures::StreamExt;πuse http::StatusCode;πuse ruma::OwnedServerName;πuse ruma::ServerName;πuse ruma::api::error::ErrorBody;πuse tuwunel_core::Error;πuse tuwunel_core::implement;πuse tuwunel_core::utils::stream::ReadyExt;πuse tuwunel_core::utils::stream::TryIgnore;πuse tuwunel_core::utils::time::now_secs;πuse tuwunel_database::Interfix;π
StructsΒ§
- Backoff π
- Latest-failure state feeding the pure
attempt_verdictdecision. - Peer
Backoff - Summarizes a peerβs current failure streak for administration.
- Streak π
- Fold state accumulated over one serverβs failure rows.
EnumsΒ§
- Classification
- Permanence classification supplied alongside a failure.
- Should
Attempt - Verdict returned by
super::Service::should_attempt.
ConstantsΒ§
- MAX_
BACKOFF π - Caps peer-status backoff delays.
FunctionsΒ§
- attempt_
verdict π - Computes a retry verdict from a peerβs latest failure state.
- classify π
- Decodes the classification byte from a peer-status value.
- classify_
error π - Classifies a failed federation attempt for the peer-reachability store.
- failure_
secs π - Decodes the recorded failure instant in seconds since the epoch.
- fold_
streak π - Folds one failure row into a serverβs running streak.
- is_
content_ rejection - Whether a failed federation attempt is a content rejection from a reachable peer, the one failure of a sent request the peer-reachability store does not record.