This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghost
assigned jacobheun
Mar 27, 2019
ghost
added
the
in progress
label
Mar 27, 2019
refactor: keep constants in one place
alanshaw
approved these changes
Mar 27, 2019
There was a problem hiding this 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.
vasco-santos
approved these changes
Mar 27, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
fix: setting 0 as a blacklist timeout
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.