Skip to content

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

@haydenyoung

Description

@haydenyoung
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    Status

    🎉Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions