From efb2259823a9059b80718773e1f32b43cc7dfe8c Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 15 Dec 2022 11:39:09 -0800 Subject: [PATCH] fixup! connection-manager: respect max_concurrent_connections config --- crates/anemo/src/network/connection_manager.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/anemo/src/network/connection_manager.rs b/crates/anemo/src/network/connection_manager.rs index aee15451..49fe4803 100644 --- a/crates/anemo/src/network/connection_manager.rs +++ b/crates/anemo/src/network/connection_manager.rs @@ -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()) {