Replies: 2 comments 3 replies
-
Thank you for reporting this @b-zee!
Do I understand correctly that these 100 connection attempts are ~simultaneous, i.e. that all of them are spawned before the first connection is fully established? I wonder why we use rust-libp2p/swarm/src/dial_opts.rs Lines 311 to 325 in 1246d83 Can you test with modified swarm/src/dial_opts.rs
@@ -313,11 +313,11 @@ pub enum PeerCondition {
/// A new dialing attempt is initiated _only if_ the peer is currently
/// considered disconnected, i.e. there is no established connection
/// and no ongoing dialing attempt.
- #[default]
Disconnected,
/// A new dialing attempt is initiated _only if_ there is currently
/// no ongoing dialing attempt, i.e. the peer is either considered
/// disconnected or connected but without an ongoing dialing attempt.
+ #[default]
NotDialing,
/// A new dialing attempt is always initiated, only subject to the
/// configured connection limits. |
Beta Was this translation helpful? Give feedback.
-
With #4224 merged I consider the immediate issue resolved. #4225 is tracked in the v0.53.0 milestone. Thanks everyone for the fruitful discussion. |
Beta Was this translation helpful? Give feedback.
-
I have a bit of a general question. We're using a combination of Kademlia, Identify, AutoNAT and a custom request/response behavior.
We're starting to see connections getting established multiple times, even 50-100 times, to the same peer. We do not manually dial much except initially during bootstrap. During this bootstrap we specify
PeerCondition::NotDialing
which prevents from dialing the same peer multiple times simultaneously. However, this doesn't seem to be happening with e.g. Kademlia.I do wonder what a good way is to debug this, as the events and logs are not really helpful so far. It's not entirely clear what behavior does the dialing or why.
My first thought is that multiplexing should be so that we have one outgoing connection and one incoming connection per peer. Not more than that. I know there is a
connection_limits
behavior, but that doesn't allow me to specify it that way.Beta Was this translation helpful? Give feedback.
All reactions