Expand description
BackoffTable - per-peer exponential backoff state used by wire
syscalls + transport adapters per ENGINE.md §10.2.
Each peer tracks consecutive failures, the timestamp of the most recent attempt, and the computed next-retry time. The backoff schedule is exponential with a configurable base and cap:
delay(n) = min(BASE_NS * 2^n, MAX_DELAY_NS)On success, clear(peer) resets state. On failure,
record_failure(peer, now_ns) bumps the attempt counter +
schedules the next retry. should_retry(peer, now_ns) reports
whether the cooldown has elapsed (peers never seen before are
always allowed to retry).
Structs§
- Backoff
State - Per-peer backoff bookkeeping.
- Backoff
Table - Per-peer exponential backoff table.
Constants§
- DEFAULT_
BASE_ NS - Default base delay (10 ms) for the first retry after a failure.
- DEFAULT_
MAX_ DELAY_ NS - Default cap (60 s). Stops the doubling from running away on long outages.