From adecfcff1a818cb6d80fd8e24412830ef0988e65 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 3 Nov 2026 02:00:58 +0100 Subject: probe list members --- src/state/peer.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/state/peer.rs') 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, /// 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; } -- cgit v1.3.1