summaryrefslogtreecommitdiffstats
path: root/src/swarm/sync.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-23 20:36:25 +0200
committertv <tv@krebsco.de>2026-10-23 20:48:19 +0200
commit7c9c903898fc15ef0b46973ddc05ee25926f3cfb (patch)
treed41245b19eb2dad41c0eaa58ef3d8cd44b9cdb99 /src/swarm/sync.rs
parent2e0b05c39138e79c49e17a52a01db82237d2a9e2 (diff)
record the cause that started a sync session
Diffstat (limited to 'src/swarm/sync.rs')
-rw-r--r--src/swarm/sync.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs
index 1335361..dc2e665 100644
--- a/src/swarm/sync.rs
+++ b/src/swarm/sync.rs
@@ -63,7 +63,8 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str, retry_delivery: bool
};
if !retry_delivery {
- if let Some(wait) = peer_state.sync.opening_wait(Instant::now()) {
+ let now = Instant::now();
+ if let Some(wait) = peer_state.sync.opening_wait(now) {
trace!(
wait_ms = wait.as_millis(),
"Leaving the opening sync message to the peer"
@@ -76,6 +77,14 @@ async fn deliver_sync_to_peer(state: &AppState, peer: &str, retry_delivery: bool
});
return Ok(());
}
+ if peer_state.sync.opening_overdue(now) {
+ debug!(
+ cause = ?peer_state.sync.cause,
+ reply_owed = peer_state.reply_owed,
+ likely = peer_state.sync.cause.missing_opening_hint(),
+ "The peer didn't open the sync within the grace period; opening ourselves"
+ );
+ }
}
swarm_id.clone()