Skip to content

libp2p doesn't always clean up connections #295

Closed
@dirkmc

Description

@dirkmc

I've created a minimal repo with a test case demonstrating an issue with libp2p cleaning up connections:
https://github.com/dirkmc/simultaneous-connection-test

It seems like when a connection is made between two peers, each dialing the other at the same time, libp2p loses track of some of the connections. Consequently, when one of the peers is shut down, only one half of the connection is closed. This means that any pull stream that is waiting on the end of the connection will never terminate.

Note: I'm not sure if this is an issue with libp2p, libp2p-switch or libp2p-mplex or websocket-star so I created a separate repo in which to test it out.

To try it out, clone the repo above, npm install and then run
DEBUG=conn-test,conn-test:* yarn test:node

Sample output:
screen shot 2018-12-10 at 6 06 43 pm

Metadata

Metadata

Assignees

Labels

P1High: Likely tackled by core team if no one steps upexp/expertHaving worked on the specific codebase is importantkind/bugA bug in existing code (including security flaws)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions