From 5f20b6723a57a17072ce9961b04fa60b3f2dcbcf Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 00:21:54 +0200 Subject: drop stall breaker; resend needed changes The stall breaker was superseded by regular re-handshaking Re-handshaking also gets triggered, when a node needs some of the heads its peer believes it has already sent. In that case the peer now resends what's needed. --- src/state.rs | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index 3abfd85..46a29d4 100644 --- a/src/state.rs +++ b/src/state.rs @@ -137,9 +137,6 @@ pub(crate) struct SyncSession { pub(crate) reply: Option, /// How long to wait for it; doubles while answers stay out. pub(crate) reply_timeout: Duration, - - /// Consecutive exchanges that changed nothing (livelock detection). - pub(crate) stalled_exchanges: u32, } /// Sync messages we sent and expect an answer to. Automerge assumes reliable delivery: @@ -165,7 +162,6 @@ impl SyncSession { outbound: None, reply: None, reply_timeout: SYNC_REPLY_TIMEOUT, - stalled_exchanges: 0, } } @@ -320,19 +316,6 @@ impl PeerState { due } - /// Schedules a fresh handshake, which resets sync on both sides: the peer resets on - /// our HELLO, we reset on its reply. The peer worker sends the HELLO on its next tick. - /// Usable without awaiting (e.g. under a blocking lock). - pub(crate) fn request_resync(&mut self) { - if matches!(self.hello_state, HelloState::Sending { .. }) { - return; // a HELLO is already on its way - } - self.hello_state = HelloState::AwaitingReply { - next_attempt: Instant::now(), - next_delay: Duration::from_millis(500), - }; - } - /// Self-healing check on PING/PONG. Returns true if a re-handshake should start. pub(crate) fn needs_heal( &mut self, -- cgit v1.3.1