-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Work around EPROTOTYPE race condition on macOS #27221
Comments
Is this specific to Yosemite? (10.10). That is far beyond support IMHO. |
It is reproducible in 10.12 (this is the version of macOS the last agent we've seen this error was running) and very well could have been an issue before 10.10, but that's the timeframe when it was first reported to libuv. This is a race condition that occurs when a send and a connection reset occur simultaneously, so it requires a loop to repro. Here's a repro written in C against sys/socket.h. This is the very detailed blog post from the original finder of the bug four years ago that tracks the bug all the way to the offending kernel code. |
thanks @halter73 . I'll give it a try. |
@wfurt do we have enough info to make it actionable? |
I think so. The next step is to isolate repro and gather some more data. |
Is there something wrong with this repro that I mentioned in my last comment? I haven't tried it myself, but it seems like what you're looking for. |
@halter73 we likely just didn't get to it ... too many high-pri bugs elsewhere and this one does not seem to be super high pri ;) |
yes, that is the one I was planning to use @halter73 |
There are some flaky tests in Kestrel that are caused by a race condition on macOS since at least Yosemite where EPROTOTYPE will sometimes be raised instead of EPIPE when sends occur during connection teardown. This results in a SocketError.ProtocolType being raised instead of the expected SocketError.Shutdown from Socket.SendAsync().
This was fixed in libuv 3 years ago by retrying the write operation. You can find more background info about this issue here.
The text was updated successfully, but these errors were encountered: