Open marcus-pousette opened 3 weeks ago
I wonder if it would make sense to have a way to call hangUp that circumvent all possible reconnection logic
I guess either that or have it throw if we would reconnect immediately? I guess it's a question of what would surprise the user the least.
In the case of a circuit relay server it's a bit more complicated - if the transport is configured to search for relays, and we hang up the connection to a connected relay, it'll start searching for a new relay immediately. The first thing it'll do is look in the peer store for relays we've been connected to recently, so yes, in this case you will probably end up reconnecting to that relay again.
Version: libp2p: 2.2.1 @libp2p/circuit-relay-v2: 3.1.0
Subsystem: circuit-relay-server
Severity:
Medium/low
Description:
I am doing some testing where I use
libp2p.hangUp(peerId)
and try to disconnect from a node that is also a circuit relay server. But it reconnects immediatelyMy question/concern is that there is no easy way to hangUp it seems in this case, unless if I perhaps also modify the peerStore to remove the KEEP_ALIVE tag (seems not to be enough from testing) I wonder if it would make sense to have a way to call
hangUp
that circumvent all possible reconnection logicSteps to reproduce the error:
Create an env with two nodes, perhaps both are also circuit relay servers. Try to handUp on the other node