Conversation
Signed-off-by: Steven Beverly <steven@arlynaccess.ai>
mkalkere
left a comment
There was a problem hiding this comment.
Good fix for the socket churn -- pooled per-interface send socket plus one long-lived receiver is the right shape.
Blocking concern: the new receiver binds 224.0.0.251:5353 without SO_REUSEADDR/SO_REUSEPORT, while the responder in the same process and the system mDNSResponder already hold that port with reuse options. On macOS the receiver bind will likely fail with EADDRINUSE and every scan returns empty -- discovery goes fully dark on the platform this is fixing. Same on Linux where node-scanner and both proxies each run a browser: first bind wins, the rest go dark. NewReceiver needs the same reuse-address control hook as the responder (with SO_REUSEPORT on darwin) before merge.
Non-blocking: net.Interfaces() polling cadence is unchanged, the receive path is IPv4-only, and per-datagram assembly drops cross-packet aggregation. Minor: despite the branch name this is a hand-rolled client rather than native mDNS, but that's cosmetic.
Thank you for the feedback on the PR. I am a little puzzled though because I double checked and the new receiver binds to port 5353 using SO_REUSEADDR and SO_REUSEPORT on macOS, here in the new socketreuse_darwin.go. Can you help identify which line of code you think is binding the port without SO_REUSEPORT? Here is a screenshot showing that port 5353 is bound shared with Chrome and PAIR using it. |

Description
Closes #59 #19 #1
Resolves macOS network stack degradation caused by two primary issues:
Scope
The change scope focuses on the mDNS implementation:
Validation
The code update was tested on a 4-node Nvidia PAIR cluster (3 macOS, 1 Windows 11), with the affected macOS node experiencing severe network issues on PAIR v0.1.1 having no issues on this PR after 2 days of operation.
Risk
Checklist
git commit -s), certifying the Developer Certificate of Origin.services/versions.json, and described user-visible changes above so they reach the release notes.