neo-go/pkg/network
Roman Khimov b8c09f509f network: add random slight delay to connection attempts
Small (especially dockerized/virtualized) networks often start all nodes at
ones and then we see a lot of connection flapping in the log. This happens
because nodes try to connect to each other simultaneously, establish two
connections, then each one finds a duplicate and drops it, but this can be
different duplicate connections on other sides, so they retry and it all
happens for some time. Eventually everything settles, but we have a lot of
garbage in the log and a lot of useless attempts.

This random waiting timeout doesn't change the logic much, adds a minimal
delay, but increases chances for both nodes to establish a proper single
connection on both sides to only then see another one and drop it on both
sides as well. It leads to almost no flapping in small networks, doesn't
affect much bigger ones. The delay is close to unnoticeable especially if
there is something in the DB for node to process during startup.
2022-11-17 18:42:43 +03:00
..
capability [#2442] English Check 2022-05-04 19:48:27 +03:00
extpool [#2442] English Check 2022-05-04 19:48:27 +03:00
payload *: use uint*Size and SignatureLen constants where appropriate 2022-10-05 10:45:52 +03:00
blockqueue.go [#2442] English Check 2022-05-04 19:48:27 +03:00
blockqueue_test.go [#2442] English Check 2022-05-04 19:48:27 +03:00
compress.go network: check compressed payload size in decompress 2022-03-24 17:22:55 +03:00
discovery.go network: add random slight delay to connection attempts 2022-11-17 18:42:43 +03:00
discovery_test.go network: add random slight delay to connection attempts 2022-11-17 18:42:43 +03:00
fuzz_test.go *: bump minimum supported go version 2022-08-08 13:59:32 +03:00
helper_test.go network: rework discoverer/server interaction 2022-11-17 17:07:19 +03:00
message.go golangci: enable errorlint and fix everything it found 2022-09-02 18:36:23 +03:00
message_string.go transaction: fix Rules stringer, it's WitnessRules in C# 2022-05-06 10:08:09 +03:00
message_test.go network: check compressed payload size in decompress 2022-03-24 17:22:55 +03:00
notary_feer.go network: decouple it from blockchainer.Blockchainer 2022-01-14 19:57:16 +03:00
peer.go network: rework discoverer/server interaction 2022-11-17 17:07:19 +03:00
prometheus.go network: add prometheus histogram with cmd processing time 2022-10-17 22:51:16 +03:00
server.go network: drop duplicationg check from handleAddrCmd() 2022-11-17 17:42:36 +03:00
server_config.go network: add BroadcastFactor to control gossip, fix #2678 2022-10-14 15:53:32 +03:00
server_test.go network: rework discoverer/server interaction 2022-11-17 17:07:19 +03:00
state_sync.go network: decouple it from blockchainer.Blockchainer 2022-01-14 19:57:16 +03:00
tcp_peer.go network: rework discoverer/server interaction 2022-11-17 17:07:19 +03:00
tcp_peer_test.go network: rework discoverer/server interaction 2022-11-17 17:07:19 +03:00
tcp_transport.go network: rework discoverer/server interaction 2022-11-17 17:07:19 +03:00
transport.go network: rework discoverer/server interaction 2022-11-17 17:07:19 +03:00