Skip to content

Commit 5de750d

Browse files
authored
Merge pull request #2119 from bitshares/pr-2015-p2p-timeout
Fix P2P connection dropping issue
2 parents 1dd4dd1 + 6cd1a4c commit 5de750d

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

libraries/net/node.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -854,17 +854,16 @@ namespace graphene { namespace net { namespace detail {
854854
// timeout for any active peers is two block intervals
855855
uint32_t active_disconnect_timeout = 10 * _recent_block_interval_in_seconds;
856856
uint32_t active_send_keepalive_timeout = active_disconnect_timeout / 2;
857-
858-
// set the ignored request time out to 1 second. When we request a block
857+
858+
// set the ignored request time out to 6 second. When we request a block
859859
// or transaction from a peer, this timeout determines how long we wait for them
860860
// to reply before we give up and ask another peer for the item.
861861
// Ideally this should be significantly shorter than the block interval, because
862-
// we'd like to realize the block isn't coming and fetch it from a different
863-
// peer before the next block comes in. At the current target of 3 second blocks,
864-
// 1 second seems reasonable. When we get closer to our eventual target of 1 second
865-
// blocks, this will need to be re-evaluated (i.e., can we set the timeout to 500ms
866-
// and still handle normal network & processing delays without excessive disconnects)
867-
fc::microseconds active_ignored_request_timeout = fc::seconds(1);
862+
// we'd like to realize the block isn't coming and fetch it from a different
863+
// peer before the next block comes in.
864+
// Increased to 6 from 1 in #1660 due to heavy load. May need to adjust further
865+
// Note: #1660 is https://github.com/steemit/steem/issues/1660
866+
fc::microseconds active_ignored_request_timeout = fc::seconds(6);
868867

869868
fc::time_point active_disconnect_threshold = fc::time_point::now() - fc::seconds(active_disconnect_timeout);
870869
fc::time_point active_send_keepalive_threshold = fc::time_point::now() - fc::seconds(active_send_keepalive_timeout);

0 commit comments

Comments
 (0)