Skip to content

Commit

Permalink
fixup! connection-manager: respect max_concurrent_connections config
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Dec 15, 2022
1 parent 67ab270 commit efb2259
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/anemo/src/network/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ impl ConnectionManager {
// Check against limit
if let Some(limit) = config.max_concurrent_connections() {
// We've hit the limit
// TODO maybe have a way to temporatily hold on to a "slot" so that we can ensure
// we don't go over this limit if multiple connections come in simultaneously.
if active_peers.len() >= limit {
// check if this is a high affinity peer to bypass the limit
match known_peers.get(&connection.peer_id()) {
Expand Down

0 comments on commit efb2259

Please sign in to comment.