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

Immediate timeout when dialling a previously dialled peer after stopping/starting libp2p #2188

Closed
haydenyoung opened this issue Nov 2, 2023 · 0 comments · Fixed by #2329 or #2330
Closed
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@haydenyoung
Copy link

  • Version:
    0.46.16

  • Platform:
    Linux 6.4.6-76060406-generic #202307241739169531258622.04~4d8f3e9 SMP PREEMPT_DYNAMIC Thu S x86_64 x86_64 x86_64 GNU/Linux

  • Subsystem:
    N/A

Severity:

Medium - A non-essential functionality does not work, performance issues, etc.

Description:

When stopping and then starting a Libp2p node, attempting to dial previously dialled peers results in an immediate TIMEOUT error.

In particular, error is:

    AbortError: The task was aborted.
        at file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/p-queue/dist/index.js:109:31
        at PQueue._PQueue_tryToStartAnother (file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/p-queue/dist/index.js:285:13)
        at file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/p-queue/dist/index.js:135:93

        at new Promise (<anonymous>)
        at PQueue.add (file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/p-queue/dist/index.js:99:16)
        at file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/libp2p/dist/src/connection-manager/dial-queue.js:343:37
        at Array.map (<anonymous>)
        at DialQueue.performDial (file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/libp2p/dist/src/connection-manager/dial-queue.js:332
:67)
        at DialQueue.dial (file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/libp2p/dist/src/connection-manager/dial-queue.js:162:36)
        at async DefaultConnectionManager.openConnection (file://~/Development/orbitdb/tests/libp2p-nodes/node_modules/libp2p/dist/src/connection-m
anager/index.js:312:28),

Steps to reproduce the error:

Launch two libp2p nodes:

const peer1 = await createLibp2pI({...})
const peer2 = await createLibp2pI({...})  

Dial peer1 from peer2

await peer2.dial(peer1)

Stop and restart peer2:

await peer2.stop()
await peer2.start()

Once started, attempt to dial peer1:

await peer2.dial(peer1)

The dial will immediately time out.

@haydenyoung haydenyoung added the need/triage Needs initial labeling and prioritization label Nov 2, 2023
achingbrain added a commit that referenced this issue Dec 20, 2023
When a node is stopped and started we need to reset the dial queue
shutdown controller otherwise every dial attempt after a restart
will be rejected as the shutdown controller signal is still aborted.

Fixes #2188
@achingbrain achingbrain added kind/bug A bug in existing code (including security flaws) and removed need/triage Needs initial labeling and prioritization labels Dec 20, 2023
achingbrain added a commit that referenced this issue Dec 20, 2023
When a node is stopped and started we need to reset the dial queue
shutdown controller otherwise every dial attempt after a restart
will be rejected as the shutdown controller signal is still aborted.

Fixes #2188
This was referenced Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
Archived in project
2 participants