Repository navigation
Conversation
stevbev
force-pushed
the
fix/mdns-hostname-claim
branch
from
November 24, 2026 17:05
b9c3e7b to
b1ae820
Compare
Noah-Tervalon-Nvidia
requested changes
Nov 25, 2026
Noah-Tervalon-Nvidia
left a comment
Collaborator
There was a problem hiding this comment.
Gonna go bug someone else for a review just to double check since this is large, but I only found the one issue.
PAIR published A records and an SRV target naming the machine's own hostname, which made it a second responder asserting the operating system's host name. macOS responds to that contention by renaming the computer's Local hostname to <name>-2. PAIR now advertises a synthetic host label derived from the node UUID, retracts every record it claimed on shutdown, and no longer hashes that label into discovery record IDs, so existing nodes neither re-key nor re-pair. Closes NVIDIA#229 Signed-off-by: Steven Beverly <thestevbev@gmail.com>
…e suite grandcat v1.0.0 sets no write deadline anywhere, and Server.Shutdown holds its shutdown lock while unregister sends the goodbye on every interface listMulticastInterfaces reports — loopback, VPN tunnels and peer-to-peer interfaces included — before it closes any socket. An interface that answers "network is unreachable" is harmless, because grandcat discards write errors, but one that accepts the packet into a queue that never drains leaves that write waiting to become writable indefinitely. Reported on an M5 mac, whose goroutine dump shows exactly that park. Route all three grandcat teardowns in the package through one bounded wait: the cleanup registerTestAdvertisement registers on behalf of every call site, the control of the hostname-claim guard, and the multicast control of the discovery diagnosis. The cleanup is the one that matters most — cleanups run one test at a time, so a parked one stalls every later test until go test's own timeout dumps the binary. A teardown that outlives the deadline is reported rather than failed: one interface that will not take a goodbye should not turn red every test that advertised anything. That report goes to the test's own *testing.T, because a throwaway one discards everything written to it. The bound frees the test, not the write: grandcat's sockets are unexported and closed only after the write returns, so a stalled advertisement is retracted when its records reach their TTL. Those records are always a synthetic label pointing at 127.0.0.1, so the residue is a dead entry a peer drops by itself, not a live node's entry being replaced. Test-only: no service binary's compiled output changes. Signed-off-by: Steven Beverly <thestevbev@gmail.com>
stevbev
force-pushed
the
fix/mdns-hostname-claim
branch
from
November 25, 2026 21:26
b1ae820 to
723e5bb
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.
Description
Closes #229
On macOS, PAIR's discovery advertisement turned the computer's Local hostname into
<name>-2.PAIR's node scanner advertises the node as one
_nvpair-node._tcprecord. Its SRV target and A records named the machine's own hostname — so PAIR became a second mDNS responder asserting a name the operating system's own responder already owned. RFC 6762 treats two responders disagreeing over a unique record as a conflict, and macOS resolves it the way Bonjour does: it renames the computer's Local hostname, appending-2. Every PAIR start re-litigated the name; nothing the user configures prevents it.The fix is one rule: PAIR now advertises a host record it owns and nobody else can claim.
nvpair-<first twelve hex digits>(example:nvpair-9d4e7c1a06b3). It is stable across restarts and link changes, and already tied to the node identity because the same UUID is in the record's TXT.No macOS configuration is involved, required, or recommended anywhere in this change — the defect was PAIR claiming a name it did not own, and the fix is PAIR stopping.
Release intent
Changelog title
PAIR no longer claims the computer's hostname on the local network
Changelog body
<name>-2suffix).Bumps
Scope
Included:
nvpair-shared/noderec:HostLabel(nodeUUID, hostname)— the one place the label rule lives (UUID → hostname-hash → refuse).nvpair-node-scanner: responder advertises the synthetic label (A records + SRV target); full PTR+SRV+TXT+A TTL-0 goodbye on shutdown;discoveryRecordIdno longer hashes the SRV host label; the cross-process test stubs advertise synthetic hosts too, so the test suite can no longer reproduce the collision in CI.architecture.mdx, and thenodereccomments describe the record as it is now advertised.Excluded deliberately:
Validation
All on macOS (Apple Silicon), live 5353 captures on one IPv4 interface; every count below re-derived independently from the raw capture files, not from grep summaries; example hostnames and addresses are pseudonymized:
make check+ desktopdead-code:check/service-contracts:check/lint/typecheck/typecheck:web/test:unit: all exit 0 on the squashed tree. All Go modulesgo test ./...clean except two pre-existing engine-manager failures that reproduce identically at clean develop tip (6bfdcdb); zero skips. Known pre-existing, unrelated:TestUninstall_TerminatesRunningInstancefails at clean develop tip too.nvpair-9d4e7c1a06b3.local.(instance name still the hostname; +1 each at TTL 0 in the goodbye).dns-sd -Q nvpair-9d4e7c1a06b3.local A→Addr IN 10.108.6.189. Thedns-sd -B/-Lbrowse pair is reported as inconclusive on the test host on purpose: a control (dns-sd -Pnative registration) proved same-host dns-sd enumeration blind there today even to the system's own stack, so the authoritative channel is raw 5353 capture plus-Q.cd services/tests && go test ./... -count=1: 99 PASS / 0 FAIL / 0 SKIP with installed PAIR off. With PAIR on it fails 15 default-port tests; representatives fail identically at develop tip with PAIR on, and the same binaries on the same tree pass all 15 off — pre-existing port contention with the installed app, no branch causation.services/versions.jsonandCHANGELOG.mduntouched — bumps declared here only.Risk
Checklist
git commit -s), certifying the Developer Certificate of Origin.services/versions.jsonis written by automation — do not edit it by hand.