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

feat: global dial queue#314

Merged
jacobheun merged 9 commits into
masterfrom
feat/dial-queue
Mar 28, 2019
Merged

feat: global dial queue#314
jacobheun merged 9 commits into
masterfrom
feat/dial-queue

Conversation

@jacobheun

@jacobheun jacobheun commented Mar 27, 2019

Copy link
Copy Markdown
Contributor

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

@alanshaw alanshaw left a comment

Copy link
Copy Markdown
Member

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.

Comment thread src/dialer/queue.js

@vasco-santos vasco-santos left a comment

Copy link
Copy Markdown
Member

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