Hotfix the large number of connections#5071
Hotfix the large number of connections#5071tomaka wants to merge 2 commits intoparitytech:masterfrom
Conversation
|
I reverted the addition of |
|
So, for my understanding, in contrast to the existing limit which affects only when a new DHT random lookup is started, this change is supposed to even cut short such a query via returning early from |
Normally it shouldn't, as the response is fetched only from the k-buckets: |
That is how a request is answered, but if a node performs a get or put operation on a Kademlia DHT, the same iterative query towards the k closest nodes to the key happens as during a |
Ah, yes that's what I want here. |
|
(note: this PR is being put on ice while we try another fix) |
|
Let's close this, since the origin issue has been fixed by #5086 |
Re-purposes
discovery_only_if_under_numintoallow_out_only_if_under_num, which blocks all new outgoing connection attempts after the limit has been reached.The limit right now is set to
value-of---out-peers + 15. Also note that it is possible that we go slightly higher than the limit, as we don't cancel pending connections. Only new connections are forbidden when above the limit.Also enables theincoming_limitfeature of theSwarmBuilderto be set to the value of--in-peers.This is obviously not great, and will possibly make discovery work way less greatly, but it should hotfix the issue with the large number of connections which we've been seeing.