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

Fix mdns taking a long time to discover peers. #2053

Merged
merged 3 commits into from
Apr 21, 2021
Merged

Conversation

dvc94ch
Copy link
Contributor

@dvc94ch dvc94ch commented Apr 21, 2021

If you start listening after mdns joined a multicast group, the peers may not discover eachother until the 5min timeout expires.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks.

Could you bump the libp2p-mdns version in protocols/mdns/Cargo.toml and Cargo.toml and add a changelog entry in protocols/mdns/CHANGELOG.md?

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Apr 21, 2021

I'm wondering now if we need if-watch in mdns at all. Since the transport already uses if-watch and detects address changes, we can probably move the join_multicast/leave_multicast to the inject_listen_addr and inject_expired_listen_addr. Not sure how well it will work on tokio-tcp.

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Apr 21, 2021

but that would be a breaking change, I still think we can merge and release this, I'll try removing if-watch and see what happens.

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Apr 21, 2021

ah won't work. even if you don't have a listening address you still want to discover other peers.

protocols/mdns/CHANGELOG.md Show resolved Hide resolved
@mxinden mxinden merged commit 29d969b into libp2p:master Apr 21, 2021
@mxinden
Copy link
Member

mxinden commented Apr 21, 2021

Tagged and published.

AgeManning pushed a commit to sigp/rust-libp2p that referenced this pull request May 4, 2021
…ibp2p#2053)

If you start listening after mdns joined a multicast group, the peers may not
discover eachother until the 5min timeout expires.

Co-authored-by: Max Inden <mail@max-inden.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants