Open tmm1 opened 2 years ago
cc @neild
Do you have a way that we can reliably reproduce the problem? Even if we have to run the test many times? That would help a great deal in knowing whether we have fixed it. Thanks.
I have observed this logged on customer installations and don't have a repro myself yet.
This particular customer is running on macOS 10.13.6
Rolling forward to 1.20. Please comment if you disagree. Thanks.
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 https://github.com/tokio-rs/mio/issues/1364 (for workarounds in libuv, dotnet, gevent)