aboutsummaryrefslogtreecommitdiffstats
path: root/src/state/peer.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 02:00:58 +0100
committertv <tv@krebsco.de>2026-11-03 02:00:58 +0100
commitadecfcff1a818cb6d80fd8e24412830ef0988e65 (patch)
treeeca30977e4308db344eeb4231efa8959e3199355 /src/state/peer.rs
parent02989b6a22a7bbd2151d6a4ea4fe6dddc9f2995b (diff)
probe list members
Diffstat (limited to 'src/state/peer.rs')
-rw-r--r--src/state/peer.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/state/peer.rs b/src/state/peer.rs
index 063b72b..ba8379a 100644
--- a/src/state/peer.rs
+++ b/src/state/peer.rs
@@ -146,7 +146,8 @@ pub(crate) struct PeerState {
pub(crate) hello_attempts: u32,
/// Since when we consider the peer unreachable (three unanswered HELLOs, or
/// dormant). Only a message from it clears it (`mark_seen`): until then it is no
- /// neighbour candidate, and a member gets probes (`probe_backoff`) instead.
+ /// neighbour candidate, and a member (by its HELLO_REPLY, or by the member list) gets
+ /// probes (`probe_backoff`) instead.
pub(crate) unreachable_since: Option<Instant>,
/// What went wrong with this peer so far (counted only, for /peers and /admin/stats).
@@ -352,8 +353,12 @@ impl PeerState {
/// No more HELLO retries (the peer isn't our neighbour any more). A HELLO in flight
/// finishes; a later handshake starts over. An unreachable member keeps its probes:
/// it is no neighbour because it is unreachable, and only its answer can change that.
- pub(crate) fn stop_hello_retries(&mut self) {
- let probed = self.is_unreachable() && matches!(self.standing, Standing::Member { .. });
+ /// A member is one whose HELLO_REPLY said so, or one `listed` in the member list: after
+ /// a restart, none has answered yet, and members that restart together may each fail
+ /// to reach the others at first; without probes, none would try again.
+ pub(crate) fn stop_hello_retries(&mut self, listed: bool) {
+ let probed =
+ self.is_unreachable() && (listed || matches!(self.standing, Standing::Member { .. }));
if !probed && matches!(self.hello_state, HelloState::AwaitingReply { .. }) {
self.hello_state = HelloState::NotSent;
}