-
Notifications
You must be signed in to change notification settings - Fork 974
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
Relay: Destination peer disconnects after idle time #2102
Comments
Yes. The connection needs to be kept alive both by the destination and the relay. The destination should keep a connection, via which it is listening, alive, more specifically rust-libp2p/protocols/relay/src/handler.rs Lines 716 to 723 in e8fed53
The relay should keep the connection alive, though today, there is no good mechanism in place to enforce this, other than by setting rust-libp2p/protocols/relay/src/behaviour.rs Lines 104 to 109 in e8fed53
In the ideal case, when the relay closes an idle connection via which a destination is listening, the destination should attempt to reconnect (likely with an exponential backoff). This is not the case today: rust-libp2p/protocols/relay/src/behaviour.rs Lines 388 to 393 in e8fed53
Is a high Let me know what you think. |
@mxinden Thanks for the detailed explanation!
Yes, that should be enough for now (you mean |
Great. Please subscribe to #2059 which will provides a solution by the protocol design.
Right. |
From what I have tested, the connection between the destination peer that is listening on a relayed address, and the associated relay, is not kept alive. Instead, it seems like it is closing after some idle time.
If then a source peer tries to connect to the destination peer, it seems like the relay is trying to relay the connection, but the destination peer rejects the incoming destination request (relay/src/behaviour.rs, line 508).
From what is written in PR #1838, the connection should be kept alive and this is a bug, but maybe I am missing something?
This issue should be replicable with this changed test https://github.com/elenaf9/rust-libp2p/blob/d587498e1d13b3cf74880b47d20f9771ab9daed8/protocols/relay/tests/lib.rs#L51, that tries to connect to the destination peer twice, with 20s delay in between.
The text was updated successfully, but these errors were encountered: