Description
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