From 928097ad62a262ace2163eea9a64217992720f9c Mon Sep 17 00:00:00 2001 From: mmgen Date: Wed, 13 Nov 2019 20:12:38 +0000 Subject: [PATCH] Increase IO_TIMEOUT to allow nodes on high-latency connections to sync (#3109) Commit d3dbafa80b "Use blocking IO in P2P to reduce CPU load" (merged into v2.1.0) introduced the constant IO_TIMEOUT, setting it to 1 second. On nodes with high-latency connections, this short timeout causes the txhashset archive download during step 2 of the IBD process to invariably fail before it completes. Since there's no mechanism for resuming a failed download, this means the node gets stuck at this stage and never syncs. Increasing IO_TIMEOUT to 10 seconds solves the issue on my node; others might suggest a more optimal value for the constant. --- p2p/src/conn.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/src/conn.rs b/p2p/src/conn.rs index fc353ad50..4bfe5bc6b 100644 --- a/p2p/src/conn.rs +++ b/p2p/src/conn.rs @@ -38,7 +38,7 @@ use std::{ thread::{self, JoinHandle}, }; -const IO_TIMEOUT: Duration = Duration::from_millis(1000); +const IO_TIMEOUT: Duration = Duration::from_millis(10000); /// A trait to be implemented in order to receive messages from the /// connection. Allows providing an optional response.