Repository navigation
fix(broadcast): give unicast its own port so broadcast actually starts - #59
Merged
Merged
Conversation
Broadcast never started with default flags. The multicast socket holds -mcast-port, and the unicast socket then bound the same port without address reuse, so Start failed with EADDRINUSE on every node. The mount logged a warning and went on, and peers only caught up after the 5s cache TTL. - Unicast gets its own port, -unicast-port (default 31338). Start rejects a unicast port equal to the multicast port. - Multicast now goes out on the unicast socket. ListenMulticastUDP turns off multicast loopback on its socket, so nodes on the same host never received each other's messages even when both sockets bound. The send socket uses the joined interface (-broadcast-iface), loopback on and the configured TTL. - A mount with -broadcast on now fails when broadcast cannot start, and names both ports and -broadcast=false. The silent fallback is what hid this bug. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…very A mount now fails when it cannot bind its broadcast ports, so every test node gets its own unicast port, and the nodes of a cluster share a multicast port no other test uses. TestBroadcastInvalidatesPeerCache gives node 1 a 1h cache TTL and checks that its open file sees data node 0 appended, which only a broadcast invalidation can cause. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 10, 2026
This was referenced Nov 13, 2026
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.
Broadcast never started with default flags. The multicast socket holds
-mcast-port, and the unicast socket then bound the same port without address reuse, soStartfailed with EADDRINUSE on every node. The mount went on without broadcast, so peers caught up only after the 5s cache TTL. main's-shortrun on .68 logs 151Failed to start cache broadcastlines.-unicast-port(default 31338).Startrejects equal ports. Firewalls must now allow UDP 31338 too.ListenMulticastUDPturns off multicast loopback on its socket, so even with the bind fixed, nodes on one host never heard each other. The send socket uses-broadcast-iface, loopback on, and the configured TTL.-broadcaston fails when broadcast cannot start, naming both ports and-broadcast=false. The silent fallback is what hid this bug.TestBroadcastInvalidatesPeerCachegives node 1 a 1h cache TTL; node 1 must still see node 0's append through an open file, which only a broadcast invalidation allows.On .68:
-shortIn Go, no other test changed result or speed by 2s or more. In Docker, per-test times moved 10-40s in both directions between single runs on a shared host. The VM failure cannot come from this PR: VMs exchanged no broadcast messages. VMs use QEMU user networking, so they cannot reach each other: broadcast starts but has no peers there.
Shared-lock leak, relevant to #29: with broadcast live,
TestMultiNodeConcurrentCreatesDoNotCollidetook 16s instead of 1s in 2 of 4 runs. Two nodes "acquired" the root directory lock at the same moment (one free, one shared add), the shared count never dropped, and the other node waited 15s to reclaim it as stale. main's run also had a stale reclaim. Broadcast adds disk reads after invalidations, so lock traffic, and these leaks, go up.PR 2 gives test nodes their own API ports and reports the harness changes.
🤖 Generated with Claude Code