Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: connection pruning #1235

Merged
merged 3 commits into from
Jun 8, 2022
Merged

fix: connection pruning #1235

merged 3 commits into from
Jun 8, 2022

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jun 7, 2022

Actually prune connections when we reach the connection limit

Prune connections when we reach the connection limit
@achingbrain
Copy link
Member Author

This is to fix a bug in the current behaviour. A follow up PR that prunes incoming connections before outgoing ones, and ranks by peer tag instead of the simple value will be necessary.

@@ -482,32 +482,46 @@ export class DefaultConnectionManager extends EventEmitter<ConnectionManagerEven
* to the lowest valued peer.
*/
async _maybeDisconnectOne () {
Copy link
Member

Choose a reason for hiding this comment

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

i think the name and docstring need update?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've changed it round to just disconnect one when we detect excessive data use/event loop slowdowns and multiple when we have too many connections.

@achingbrain achingbrain merged commit f9073ec into master Jun 8, 2022
@achingbrain achingbrain deleted the fix/connection-pruning branch June 8, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants