go-ethereum/p2p/dnsdisc
Felix Lange d36276d85e
p2p/dnsdisc: fix hot-spin when all trees are empty (#22313)
In the random sync algorithm used by the DNS node iterator, we first pick a random
tree and then perform one sync action on that tree. This happens in a loop until any
node is found. If no trees contain any nodes, the iterator will enter a hot loop spinning
at 100% CPU.

The fix is complicated. The iterator now checks if a meaningful sync action can
be performed on any tree. If there is nothing to do, it waits for the next root record
recheck time to arrive and then tries again.

Fixes #22306
2021-02-19 09:54:46 +01:00
..
client.go p2p/dnsdisc: fix hot-spin when all trees are empty (#22313) 2021-02-19 09:54:46 +01:00
client_test.go p2p/dnsdisc: fix hot-spin when all trees are empty (#22313) 2021-02-19 09:54:46 +01:00
doc.go p2p/dnsdisc: add implementation of EIP-1459 (#20094) 2019-09-25 11:38:13 +02:00
error.go p2p/dnsdisc: add implementation of EIP-1459 (#20094) 2019-09-25 11:38:13 +02:00
sync.go p2p/dnsdisc: fix hot-spin when all trees are empty (#22313) 2021-02-19 09:54:46 +01:00
sync_test.go p2p/dnsdisc: add enode.Iterator API (#20437) 2019-12-12 11:15:36 +02:00
tree.go p2p/dnsdisc: add enode.Iterator API (#20437) 2019-12-12 11:15:36 +02:00
tree_test.go p2p/dnsdisc: add enode.Iterator API (#20437) 2019-12-12 11:15:36 +02:00