Expand description
Reconnect backoff for lazy transports (#156).
ReconnectBackoff tracks consecutive failed dial attempts and computes an
exponential-backoff cooldown window between them. The lazy transports hold one
ReconnectBackoff alongside their cached session so failed dials don’t
tight-loop on a downed peer — matching the explicit tokio::time::sleep
backoff that zmq_connection.rs used to perform.
§Design
LazyStatebundles the optional cached transport + backoff so they stay consistent under a single lock: “no cached session” always implies “may be in backoff.”invalidate()callsrecord_failure()so a send-path transport error also counts against the backoff budget (not only dial failures).INITIAL_BACKOFFis 1 s; subsequent failures double up toMAX_BACKOFF(30 s), matching the ZMQ reconnect interval cap observed in practice.
§What #156 defers
DID-doc re-resolve on re-dial (so the manager picks up a moved service
entry) requires async resolution which can’t run inside the sync lock; that
layer is left for a future incremental PR and documented with a TODO below.
Structs§
- Lazy
State - Combined lazy-connect state: the optional cached transport + reconnect backoff.
- Reconnect
Backoff - Exponential-backoff cooldown tracker for RPC reconnect attempts.