hiredis icon indicating copy to clipboard operation
hiredis copied to clipboard

redisNetWrite crashes application process with Signal: SIGPIPE (Broken pipe) on linux if target socket was closed while sending data

Open dyumin opened this issue 1 year ago • 0 comments

Please consider using MSG_NOSIGNAL send() option

MSG_NOSIGNAL (since Linux 2.2)
      Don't generate a SIGPIPE signal if the peer on a stream-oriented
      socket  has closed the connection.  The EPIPE error is still re‐
      turned.  This provides similar behavior to using sigaction(2) to
      ignore SIGPIPE, but, whereas MSG_NOSIGNAL is a per-call feature,
      ignoring SIGPIPE sets  a  process  attribute  that  affects  all
      threads in the process.

dyumin avatar Sep 19 '23 12:09 dyumin