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.
This commit is contained in:
mmgen 2019-11-13 20:12:38 +00:00 committed by hashmap
parent 76ac9419b8
commit 928097ad62

View file

@ -38,7 +38,7 @@ use std::{
thread::{self, JoinHandle}, 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 /// A trait to be implemented in order to receive messages from the
/// connection. Allows providing an optional response. /// connection. Allows providing an optional response.