Set MSG_NOSIGNAL for UnixStream by mlowicki · Pull Request #140005 · rust-lang/rust (original) (raw)

In general, ignoring SIGPIPE and producing EPIPE is often a good idea. However, I'm not sure if this change is something we can or should do on behalf of the user without knowing what they want, for multiple reasons.

The minor reason is that the user might not be expecting EPIPE. However, I think that's less of a problem for things other than stdout/stderr.

The larger reason is that switching from write to send could break users who convert something other than a socket to a UnixStream, because send doesn't work on non-sockets.

I think it's still reasonable to consider this change, but we're going to want to announce it as a potential compatibility issue.