net: EPROTOTYPE surfaced from write() on macOS due to kernel bug #51538
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Darwin
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a http server running on macOS, which uses
io.Copy()
to stream data out to the http response writer.What did you expect to see?
When the client closes the socket, I expect to see ECONNRESET or EPIPE
What did you see instead?
I sometimes see EPROTOTYPE instead:
This appears to be due to a well-documented macOS kernel bug: http://erickt.github.io/blog/2014/11/19/adventures-in-debugging-a-potential-osx-kernel-bug/
Many other runtimes have experienced this issue, and the suggested workaround is to retry the
write
operation.See https://bugs.python.org/issue44229 and similar links on tokio-rs/mio#1364 (for workarounds in libuv, dotnet, gevent)
The text was updated successfully, but these errors were encountered: