-
Notifications
You must be signed in to change notification settings - Fork 445
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
Pubsub appears to be opening multiple streams and not closing them #668
Comments
Hm. This behavior appears to be limited to a few peers. But we should still verify that we're closing streams when done (@jacobheun couldn't find where this was happening). |
I did a small experiment with a test 9f07273 Having js older peers with bidirectional streams talking with js with unidirectional streams could cause issues, but on the preload nodes I still did not understand what might be the issue |
It looks like it's just a few peers with a ton of streams. I'm not sure what's going on there. Could be an old bug, could be a malicious peer, could be anything. |
@Stebalien do you have any logs or any other information that I can look at? |
@vasco-santos my best guess is that for some reason we're getting multiple connect calls to a peer, https://github.com/libp2p/js-libp2p-pubsub/blob/v0.5.2/src/index.js#L194-L201, and instead of checking for an existing Peer/stream, we're creating a new one to them. The particular version of libp2p might be hard to track down but we should make sure that pubsub doesn't create new streams for a peer if it already has one. |
FYI, I created a PR to guarantee that we do not open a new stream if we already have one. However, we should guarantee that the |
This should be fixed in the latest pubsub. |
On the preload nodes, I'm noticing ~500 connections to js-libp2p peers, but 22K open streams to these peers, most of them inbound pubsub streams. It looks like js-libp2p-pubsub is opening multiple streams per connection and not closing them.
The text was updated successfully, but these errors were encountered: