From bf8653b6c20af5a28a23c6ea05ce0cf811b7d72a Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Fri, 21 Apr 2023 14:19:50 +0200 Subject: [PATCH] node: Fix keep-alive delta By having the keep-alive delta be the same as the ping timeout, we essentially disconnected peers right after we sent them our first ping. This fixes that issue by setting the ping timeout to double the keep-alive delta. --- radicle-node/src/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/radicle-node/src/service.rs b/radicle-node/src/service.rs index 1c3e4a16..793e67b5 100644 --- a/radicle-node/src/service.rs +++ b/radicle-node/src/service.rs @@ -63,7 +63,7 @@ pub const SYNC_INTERVAL: LocalDuration = LocalDuration::from_secs(60); /// How often to run the "prune" task. pub const PRUNE_INTERVAL: LocalDuration = LocalDuration::from_mins(30); /// Duration to wait on an unresponsive peer before dropping its connection. -pub const STALE_CONNECTION_TIMEOUT: LocalDuration = LocalDuration::from_mins(1); +pub const STALE_CONNECTION_TIMEOUT: LocalDuration = LocalDuration::from_mins(2); /// How much time should pass after a peer was last active for a *ping* to be sent. pub const KEEP_ALIVE_DELTA: LocalDuration = LocalDuration::from_mins(1); /// Maximum time difference between the local time, and an announcement timestamp.