#1229·hiredis

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

Author: dyuminCreated Sep 19, 2023Updated Jan 23, 2024

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.