Repository navigation
fix(discovery): send several queries per round instead of one - #2
Merged
Merged
Conversation
The zeroconf library sends one query when a browse starts and the next one four seconds later, so a longer window does not help. Against a real avahi-daemon about a quarter of single queries went unanswered (7/10 rounds with a 4 s window, 14/20 with 2 s and 3 s, 16/20 with 1 s), which with a three-round TTL would take nodes offline now and then. A round is now split into three short browses, each with a fresh query, and the answers are merged: 30/30 rounds found the node. The default window grows from 4 s to 6 s (3 x 2 s). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Member
Author
|
Merged (merge commit 596987a) and tagged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Found while running a real moip-toolkit node (avahi-daemon, as on utone-linux) next to moipctl's discovery: a single mDNS query is answered only about 70-80% of the time, so a round of
ZeroconfBrowseroften came back empty.The zeroconf library sends one query when a browse starts and the next one only after four seconds, so lengthening the window adds nothing. With the three-round TTL (
--scout-ttl 45s) a 25% miss rate per round would take nodes offline from time to time.Now a round is split into three short browses (a fresh query each), and the answers are merged (the latest answer per node ID wins). The default window grows from 4 s to 6 s so every pass gets 2 s;
scout --windowsays so.Testing
test/node, in a separate PR): the 30/30 above.Not covered: avahi's rate limiting on a real multi-host network may differ from one host.
🤖 Generated with Claude Code