neoneo-go/pkg/network
Roman Khimov 7ee8f9c5d8 network: fix networking stalls caused by stale peers
We can leak sending goroutines and stall broadcasts because of already gone
peers that happened to be cached by some s.Peers() user (more than 800 of
these can be seen in nodoka log along with (*Server).run blocking on
CMDGetAddr send):

Feb 10 16:35:15 nodoka neo-go[1563]: goroutine 41 [chan send, 3320 minutes]:
Feb 10 16:35:15 nodoka neo-go[1563]: github.com/CityOfZion/neo-go/pkg/network.(*TCPPeer).putPacketIntoQueue(...)
Feb 10 16:35:15 nodoka neo-go[1563]:         /go/src/github.com/CityOfZion/neo-go/pkg/network/tcp_peer.go:81
Feb 10 16:35:15 nodoka neo-go[1563]: github.com/CityOfZion/neo-go/pkg/network.(*TCPPeer).EnqueueHPPacket(0xc0083d57a0, 0xc017206100, 0x18, 0x40, 0x136a240, 0xc018ef9720)
Feb 10 16:35:15 nodoka neo-go[1563]:         /go/src/github.com/CityOfZion/neo-go/pkg/network/tcp_peer.go:119 +0x98
Feb 10 16:35:15 nodoka neo-go[1563]: github.com/CityOfZion/neo-go/pkg/network.(*Server).iteratePeersWithSendMsg(0xc0000ca000, 0xc0001848a0, 0xcb4550, 0x0)
Feb 10 16:35:15 nodoka neo-go[1563]:         /go/src/github.com/CityOfZion/neo-go/pkg/network/server.go:720 +0x12a
Feb 10 16:35:15 nodoka neo-go[1563]: github.com/CityOfZion/neo-go/pkg/network.(*Server).broadcastHPMessage(...)
Feb 10 16:35:15 nodoka neo-go[1563]:         /go/src/github.com/CityOfZion/neo-go/pkg/network/server.go:731
Feb 10 16:35:15 nodoka neo-go[1563]: github.com/CityOfZion/neo-go/pkg/network.(*Server).run(0xc0000ca000)
Feb 10 16:35:15 nodoka neo-go[1563]:         /go/src/github.com/CityOfZion/neo-go/pkg/network/server.go:203 +0xee4
Feb 10 16:35:15 nodoka neo-go[1563]: github.com/CityOfZion/neo-go/pkg/network.(*Server).Start(0xc0000ca000, 0xc000072c60)
Feb 10 16:35:15 nodoka neo-go[1563]:         /go/src/github.com/CityOfZion/neo-go/pkg/network/server.go:173 +0x2ec
Feb 10 16:35:15 nodoka neo-go[1563]: created by github.com/CityOfZion/neo-go/cli/server.startServer
Feb 10 16:35:15 nodoka neo-go[1563]:         /go/src/github.com/CityOfZion/neo-go/cli/server/server.go:331 +0x476
2020-02-10 18:47:52 +03:00
..
metrics cli,pkg: use zap.Logger 2020-01-10 11:14:27 +03:00
payload network: fix minor gofmt issues (spotted by goreportcard) 2020-02-08 15:53:08 +03:00
blockqueue.go network: fix block relaying, don't spit out useless errors 2020-02-06 15:41:56 +03:00
blockqueue_test.go network: fix block relaying, don't spit out useless errors 2020-02-06 15:41:56 +03:00
discovery.go network: register connected addr in handleVersionCmd() 2020-01-30 14:03:52 +03:00
discovery_test.go network: rework discovery with rwmutex, add test 2019-10-28 13:37:27 +03:00
helper_test.go core/mempool: fix AddBlock and tx pooling concurrency issues 2020-02-06 15:41:52 +03:00
message.go network: introduce peer sending queues 2020-01-20 17:23:26 +03:00
message_test.go Node improvements (#47) 2018-03-14 10:36:59 +01:00
peer.go network: introduce peer-to-peer message queue 2020-01-30 14:03:52 +03:00
prometheus.go monitoring: add prometheus monitoring 2019-10-29 20:51:17 +03:00
relay_reason.go fix spelling and godoc comments 2019-10-22 17:56:03 +03:00
server.go network: fix block relaying, don't spit out useless errors 2020-02-06 15:41:56 +03:00
server_config.go network: fix minor gofmt issues (spotted by goreportcard) 2020-02-08 15:53:08 +03:00
server_test.go network: move SendVersion() to the Peer 2020-01-21 17:26:08 +03:00
tcp_peer.go network: fix networking stalls caused by stale peers 2020-02-10 18:47:52 +03:00
tcp_peer_test.go network: move SendVersion() to the Peer 2020-01-21 17:26:08 +03:00
tcp_transport.go network: move per-peer goroutines into the TCPPeer 2020-01-20 17:23:26 +03:00
transport.go Fixed some networking issues (#68) 2018-04-13 12:14:08 +02:00