fix: send goodbye packets under conflict-resolved names - #495
Merged
Conversation
keepsimple1
approved these changes
Aug 22, 2026
keepsimple1
left a comment
Owner
There was a problem hiding this comment.
Thank you for the fix! LGTM, with a minor comment inline.
When probing renames a record due to a name conflict (RFC 6762 section 9), announcements and query responses use the new name via DnsRegistry::name_changes, but unregister_service still built the TTL=0 goodbye records from the original ServiceInfo names. Peers that cached the renamed records never saw a matching goodbye, so an auto-renamed instance lingered in browsers until its record TTLs expired after unregister or shutdown. Resolve the service fullname and hostname through the interface's DnsRegistry when building the goodbye packet, so the goodbye carries the names peers actually cached. Add a regression test that forces a conflict rename and verifies a browser sees ServiceRemoved for the renamed instance promptly after unregister.
dhavli
force-pushed
the
fix-goodbye-renamed-records
branch
from
August 25, 2026 10:51
299430f to
076255a
Compare
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.
Problem
When probing renames a record after a name conflict (RFC 6762 section 9), announcements and query responses correctly use the new name via
DnsRegistry::name_changes/resolve_name. Butunregister_servicestill builds the TTL=0 goodbye records from the originalServiceInfonames.Peers on the link only ever cached the renamed records, so the goodbye never matches anything in their caches. An auto-renamed instance therefore lingers in browse lists until its record TTLs expire after
unregister()orshutdown(), instead of disappearing within seconds.Fix
Resolve the service fullname and hostname through the interface's
DnsRegistry(the sameresolve_nameused byprepare_announce) when building the goodbye packet inunregister_service, so the goodbye carries the names peers actually cached. Interfaces without a registry entry keep the original names, as before.Test
Added
test_goodbye_uses_conflict_resolved_name: it forces a conflict rename between two daemons, resolves the renamed instance from a third (browser) daemon, unregisters the renamed service, and asserts the browser receivesServiceRemovedfor the renamed fullname well before any TTL could expire.The test fails on current
main(no goodbye ever observed for the renamed instance) and passes with this change. Fullcargo testpasses.