Skip to content

Suppress SIGPIPE on socket writes where supported - #1408

Open
ashutosh-agrawal wants to merge 1 commit into
redis:masterfrom
ashutosh-agrawal:fix/net-write-nosignal
Open

ashutosh-agrawal wants to merge 1 commit into
redis:masterfrom
ashutosh-agrawal:fix/net-write-nosignal

Conversation

@ashutosh-agrawal

@ashutosh-agrawal ashutosh-agrawal commented Nov 24, 2026 •

Copy link
Copy Markdown

A write to a closed connection can stop the program with SIGPIPE. Use MSG_NOSIGNAL where available so hiredis can report the write error.

The earlier attempt in #840 was closed because the flag isn't available everywhere.

All 181 hiredis tests passed on Debian Trixie.


Note

Low Risk
Small, conditional networking change in the write path; no auth, data, or API surface changes.

Overview
redisNetWrite now passes MSG_NOSIGNAL to send when the platform defines it, instead of always using flags 0.

Writes to a peer-closed socket return a normal I/O error via hiredis’s existing REDIS_ERR_IO path instead of terminating the process with SIGPIPE. Platforms without MSG_NOSIGNAL keep the previous behavior with no compile-time change.

Reviewed by Cursor Bugbot for commit c186502. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T01:21:03.111235Z c186502 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant