From 4cff87560ba238ba6eebd16b1465c0ebae2f6ac2 Mon Sep 17 00:00:00 2001 From: murilo ijanc Date: Wed, 25 Mar 2026 16:52:03 -0300 Subject: Remove stale peers without replacement from routing table When a peer exceeds STALE_THRESHOLD failures and the replacement cache is empty, remove it outright instead of leaving it in the bucket indefinitely. Prevents phantom peer accumulation in small clusters where the cache rarely fills. --- src/handlers.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/handlers.rs') diff --git a/src/handlers.rs b/src/handlers.rs index f4c5b2c..574aca3 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -849,8 +849,7 @@ impl Node { .closest .iter() .find(|p| { - q.queried.contains(&p.id) - && p.id != sender_id + q.queried.contains(&p.id) && p.id != sender_id }) .cloned(); @@ -866,9 +865,7 @@ impl Node { is_unique: false, }; if let Err(e) = self.send_store(&peer, &store_msg) { - log::debug!( - "Republish-on-access failed: {e}" - ); + log::debug!("Republish-on-access failed: {e}"); } else { log::debug!( "Republished value to {:?} (nearest without)", -- cgit v1.2.3