-
Notifications
You must be signed in to change notification settings - Fork 950
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
mDNS records expire when connection times out #3309
Comments
Thanks for the detailed report. I think your point is valid, i.e. connection closing does not correlate with availability of a remote's address. A patch would be very welcome. |
I'll see what I can do |
felinira
added a commit
to felinira/rust-libp2p
that referenced
this issue
Jan 23, 2023
felinira
added a commit
to felinira/rust-libp2p
that referenced
this issue
Jan 23, 2023
4 tasks
felinira
added a commit
to felinira/rust-libp2p
that referenced
this issue
Jan 23, 2023
mergify bot
pushed a commit
that referenced
this issue
Jan 27, 2023
mDNS records should not be expiring when an unrelated connection timeout with said peer is reached. Fixes #3309.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
mDNS records are expiring when an unrelated connection timeout with said peer is reached (eg. the gossipsub default of 120 seconds, or the floodsub default of… 10 seconds?). The problem is that connections may close for any unrelated reason. This does not render the peer unreachable. It is completely valid to reopen a connection to the peer again in many cases.
From the docs of
mdns::Event
:The current behavior differs from the documentation and will expire nodes for any connection related timeout that has nothing to do with mDNS.
The examples are suggesting that an expired node is not reachable anymore and remove them from eg. gossipsub/floodsub. But this is not true if the connection has stopped due to a timeout and the peer remains reachable / the TTL has not yet expired.
Expected behaviour
mDNS nodes only expire when their DNS TTL is reached and unrelated connection issues and timeouts will not expire mDNS nodes.
Actual behaviour
mDNS nodes expire when a related connection times out. This makes floodsub-based chats completely unusable and gossipchat-based chats will expire after 120 seconds.
Debug output of the connection timeout in example
chat-tokio
. I added a few println! statements to the mDNS events. The peer is expired 10 seconds after discovery.Debug Output
Possible Solution
Version
Would you like to work on fixing this bug?
Maybe
The text was updated successfully, but these errors were encountered: