8bb1ecb45a
Use circular buffer which is a bit more appropriate. The problem is that priority queue accepts and stores equal items which wastes memory even in normal usage scenario, but it's especially dangerous if the node is stuck for some reason. In this case it'll accept from peers and put into queue the same blocks again and again leaking memory up to OOM condition. Notice that queue length calculation might be wrong in case circular buffer wraps, but it's not very likely to happen (usually blocks not coming from the queue are added by consensus and it's not very fast in doing so). |
||
---|---|---|
.. | ||
capability | ||
extpool | ||
metrics | ||
payload | ||
blockqueue.go | ||
blockqueue_test.go | ||
compress.go | ||
discovery.go | ||
discovery_test.go | ||
helper_test.go | ||
message.go | ||
message_string.go | ||
message_test.go | ||
notary_feer.go | ||
peer.go | ||
prometheus.go | ||
server.go | ||
server_config.go | ||
server_test.go | ||
tcp_peer.go | ||
tcp_peer_test.go | ||
tcp_transport.go | ||
transport.go |