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

Can not disconnect from a circuit-relay server node #2794

Open
marcus-pousette opened this issue Oct 30, 2024 · 0 comments
Open

Can not disconnect from a circuit-relay server node #2794

marcus-pousette opened this issue Oct 30, 2024 · 0 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@marcus-pousette
Copy link
Contributor

marcus-pousette commented Oct 30, 2024

  • 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 immediately

  at DefaultConnectionManager.openConnection (file:///path-to-project/node_modules/libp2p/src/connection-manager/index.ts:484:10)
    at pRetry.signal (file:///path-to-project/node_modules/libp2p/src/connection-manager/reconnect-queue.ts:83:40)
    at RetryOperation._fn (file:///path-to-project/node_modules/p-retry/index.js:57:26)
    at RetryOperation.attempt (/path-to-project/node_modules/p-retry/node_modules/retry/lib/retry_operation.js:116:8)
    at file:///path-to-project/node_modules/p-retry/index.js:55:13
    at new Promise (<anonymous>)
    at pRetry (file:///path-to-project/node_modules/p-retry/index.js:31:9)
    at Job.queue.add.peerId.peerId [as fn] (file:///path-to-project/node_modules/libp2p/src/connection-manager/reconnect-queue.ts:77:13)
    at Job.run (file:///path-to-project/node_modules/@libp2p/utils/src/queue/job.ts:77:44)
    at PeerQueue.tryToStartAnother (file:///path-to-project/node_modules/@libp2p/utils/src/queue/index.ts:191:16)
    at PeerQueue.add (file:///path-to-project/node_modules/@libp2p/utils/src/queue/index.ts:233:10)
    at ReconnectQueue.maybeReconnect (file:///path-to-project/node_modules/libp2p/src/connection-manager/reconnect-queue.ts:76:16)

My 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 logic

Steps to reproduce the error:

Create an env with two nodes, perhaps both are also circuit relay servers. Try to handUp on the other node

@marcus-pousette marcus-pousette added the need/triage Needs initial labeling and prioritization label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant