Skip to main content

Module peer

Module peer 

Source
Expand description

Per-server reachability store backed by the servername_status CF.

Bucket key layout: servername || u64_be(now.as_secs() / window_secs). The one-byte value is the Classification. Bursts within the same window collide on the same key, which is a correct collision (the window is the coalescing quantum). The storage layout is the batch.

window_secs is sourced from sender_timeout at service build time so the peer-status curve does not drift from the sender’s existing quadratic backoff when both observe the same peer.

Enums§

Classification
Permanence classification supplied alongside a failure.
ShouldAttempt
Verdict for [Service::should_attempt].

Constants§

MAX_BACKOFF 🔒
Backoff ceiling, matching sender_retry_backoff_limit’s 24h default.

Functions§

classify 🔒
classify_error 🔒
Classifies a failed federation attempt for the peer-reachability store, or None when it carries no reachability signal. An HTTP response proves the peer reachable, so a content-level 4xx (a forbidden invite, a 403 backfill) must not count against it; only 5xx or an explicit rate-limit (429) records Transient. A 410 is the exception: a Matrix server never returns it for one endpoint and not another, so a received 410 is a proxy operator deliberately signaling the peer is gone, and records Permanent. Transport failures carry no response and are always transient.