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

Manage an initial delay before the first mdns query is sent on an interface #3319

Closed
stormshield-pj50 opened this issue Jan 11, 2023 · 2 comments · Fixed by #3975
Closed

Comments

@stormshield-pj50
Copy link
Contributor

stormshield-pj50 commented Jan 11, 2023

Description

Based on identify behaviour, manage an initial delay before the first mdns query is sent on an interface.

Motivation

In a docker environment, the first mdns query can be lost if the interface is not ready yet. As the interval query is by default rather large (5 minutes), using an initial delay before the first mdns query is sent would improve the speed of peers discovery.

Current Implementation

No way to configure an initial delay.

Are you planning to do it yourself in a pull request?

Yes

@thomaseizinger
Copy link
Contributor

Interesting, I wonder if we can be more a bit more clever here.

Would it make sense to retry sending the first packet on a more frequent interval if we don't get a response within X seconds? We'd have to be careful to not spam the network too much so a max number of retries is probably a good idea.

@stormshield-damiend
Copy link

stormshield-damiend commented Jan 13, 2023

Indeed this is a good idea. We already have the work done for an initial_delay configuration token (as in identify) and will submit a PR soon. This is sufficient to fix our issue in docker, feel free to duplicate or create another issue for the iterative query at start.

@mergify mergify bot closed this as completed in #3975 May 25, 2023
mergify bot pushed a commit that referenced this issue May 25, 2023
Peer discovery with mDNS can be very slow, particularly if the first mDNS query is lost. This patch resolves it by adjusting the timer with an adaptive initial interval. We start with a very short timer (500 ms). If a peer is discovered before the end of the timer, then the timer is reset to the normal query interval value (300s), otherwise the timer's value is multiplied by 2 until it reaches the normal query interval value.

Related: #3323.
Resolves: #3319.

Pull-Request: #3975.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants