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

When failing to establish WebRTC connection a "half open" connection can occur #2646

Open
marcus-pousette opened this issue Aug 1, 2024 · 1 comment
Labels
need/triage Needs initial labeling and prioritization

Comments

@marcus-pousette
Copy link
Contributor

marcus-pousette commented Aug 1, 2024

Severity:

Medium/High

Description:

I am investing issues I am having when using the WebRTC transport between nodes in offline mode, and I seem to end up in a unexpected state sometimes when a WebRTC connection is failing to establish, but only one side realizes this.

My main concern with this issue is that WebRTC connections could fail out in the wild (for other reasons than the reproduction method below) and if that leads to bad user experience

Steps to reproduce the error:

When using this example (update all dependencies or use them as is)

https://github.com/libp2p/js-libp2p-examples/tree/main/examples/js-libp2p-example-browser-pubsub

Turn WIFI off completely on your computer (this seems to disable WebRTC connections to be establish at all even if you connect to another node on the same machine).

Now run the example with two nodes and try to connect them to each other (one connects to the relay, the other one connects to the webrtc address of the first node).

Connected peers on the first node only shows the relay node (1 connection in total), expected because it failed to establish a WebRTC connection.

BUT the node that is dialing never realizes that something wrong has happened (!) and still shows that it is connected to both the relay and the WebRTC connection (2 connections in total).

The expected outcome is that both nodes realizes that the WebRTC connection was never establish.

....
In earlier version of libp2p (1.0.8 (?)) (the version that is now in the (js-libp2p-example-browser-pubsub)) you will get an error message that indicates that the WebRTC connection was aborted without reason on the first node, but I am leaving that out of the description here since it might not apply 1.8.2. But the outcome is the same in the end

@marcus-pousette marcus-pousette added the need/triage Needs initial labeling and prioritization label Aug 1, 2024
@marcus-pousette marcus-pousette changed the title When failing to establish WebRTC connection yields to "half open" connection When failing to establish WebRTC connection a "half open" connection can occur Aug 1, 2024
@achingbrain
Copy link
Member

achingbrain commented Aug 1, 2024

That's interesting, I think something like #2644 would help here, at least in that it'd clean up dead/stuck connections after a short time.

We should be able to handle this scenario better though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants