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

connmgr: prefer peers with no streams when closing connections #1675

Merged
merged 2 commits into from
Aug 19, 2022

Conversation

MarcoPolo
Copy link
Collaborator

This prioritized closing connections with peers that have no active streams. This enables us to prune inactive connections rather than a potentially active but lower value connection.

Removes SortByValue and changes SortByValueAndStreams to work for both the normal case and the emergency memory free up mode.

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

This change looks good to me.

At some point in the future, we probably should make this act on connections, not on peers. For example, if we have more than a single connection to a peer, we should prune the duplicate connections first (interesting question: how would we decide if to prune a TCP connection with more streams vs a QUIC connection with fewer streams).

@marten-seemann marten-seemann changed the title Prefer peers with no streams when closing connections in connmgr connmgr: prefer peers with no streams when closing connections Aug 13, 2022
@MarcoPolo MarcoPolo merged commit 6472f8c into master Aug 19, 2022
@MarcoPolo MarcoPolo deleted the marco/prefer-conns-no-streams branch August 19, 2022 23:59
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.

2 participants