From f1a50af7d3048e6ea9fca700e8d19ecb537fd504 Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Wed, 14 Oct 2026 11:32:40 +0700 Subject: [PATCH] fix(reflectors): retain current peers when no candidates respond MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore the pre-probe selection when evaluation finds no usable candidates. Preserve master’s existing selection of smaller candidate sets. --- src/reflector_selector.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/reflector_selector.rs b/src/reflector_selector.rs index 92c1227..d348003 100644 --- a/src/reflector_selector.rs +++ b/src/reflector_selector.rs @@ -167,6 +167,7 @@ impl ReflectorSelector { let mut next_peers: Vec = Vec::new(); let mut reflectors_peers = self.reflector_peers_lock.write_anyhow()?; + let current_peers = reflectors_peers.clone(); // Include all current peers for reflector in reflectors_peers.iter() { @@ -236,6 +237,13 @@ impl ReflectorSelector { candidates.swap(i, j); } + if candidates.is_empty() { + info!("No usable reflectors, retaining current set"); + self.reflector_tx.send(current_peers.clone())?; + *reflectors_peers = current_peers; + continue; + } + if (candidates.len() as u8) < num_reflectors { num_reflectors = candidates.len() as u8; }