-
Notifications
You must be signed in to change notification settings - Fork 17.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: listening on dual-stack UDP socket sometimes silently fails on macOS #67226
Comments
Thanks for the report. Does the failure happens only on macOS? And it doesn't fail on other OSes? Does the failure reproduce if you don't capture traffic in Wireshark?
Could you share a full buildable version of the test? Thanks. |
As far as I can tell, yes. I tested it on Linux and Windows (on CI), and it seems to work there.
Yes.
Sure! I updated the Gist: https://gist.github.com/marten-seemann/bfa811133331b9c053137fd5df12638d. |
From what I can tell, this seems to be a macOS bug. I rewrote the test in C, and I'm seeing the same failure there: https://gist.github.com/marten-seemann/67eecb83006fdc020456821b69112385 (see comment there for how to run it). |
This seems likely to be the cause of https://go.dev/issue/29225 as well. |
Go version
go version go1.22.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I start a dual-stack UDP listener:
Then I send a UDP datagram (from localhost) to this listener and assert that this packet is received. At the same time, I capture all traffic on localhost using Wireshark.
https://gist.github.com/marten-seemann/bfa811133331b9c053137fd5df12638d
What did you see happen?
Running the test 10000 times, I pretty reliably get a test failure on macOS. The datagram is sent (as confirmed by the Wireshark trace), but it never arrives at the listener.
This is not caused by UDP packet loss (which shouldn't happen on localhost anyway). To make sure that this is not the cause of the problem, I added another test (
TestUDPUnconnectedDualStackWithRetransmission
), which retransmits the datagram up to 50 times.This bug is the source of a lot of flakiness in quic-go's test suite. We're running a lot of UDP transfers to test all facets of the protocol, enough to hit this bug on every other CI run or so.
What did you expect to see?
I expect the packet to be received reliably. This test should never fail.
The text was updated successfully, but these errors were encountered: