Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

feat: global dial queue #314

Merged
merged 9 commits into from
Mar 28, 2019
Merged

feat: global dial queue #314

merged 9 commits into from
Mar 28, 2019

Conversation

jacobheun
Copy link
Contributor

@jacobheun jacobheun commented Mar 27, 2019

This adds a general dial queue to the switch. All dial requests are added to the QueueManager. The QueueManager ensures no more than the maximum parallel dials requests are allowed (currently 50).

This also adds basic blacklisting with a ttl of 120 seconds. If a dial attempt errors, no dials to it will be allowed until the ttl has expired, or the blacklist has been manually cleared. Future iterations of this should add an exponential backoff for blacklisting to better manage repeat offending peers.

This alleviates issues where libp2p discovers a large number of peers, such as through the dht, and dial attempts are made to all of them. High numbers of concurrent dials lead to the cpu overloading.

@ghost ghost assigned jacobheun Mar 27, 2019
@ghost ghost added the in progress label Mar 27, 2019
@jacobheun jacobheun marked this pull request as ready for review March 27, 2019 13:37
@jacobheun jacobheun changed the title [WIP] feat: global dial queue feat: global dial queue Mar 27, 2019
Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one suggestion :) This'll do the job for now until we can improve perf or assign some sort of priority to connections.

src/dialer/queue.js Show resolved Hide resolved
Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jacobheun jacobheun merged commit 20175dd into master Mar 28, 2019
@jacobheun jacobheun deleted the feat/dial-queue branch March 28, 2019 08:25
@ghost ghost removed the in progress label Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants