Repository navigation
Fix Linux TCP connect error queue in hiredis - #15917
Merged
Merged
Conversation
Co-authored-by: Steve Wills <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit dde7db1. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #15917 +/- ##
============================================
+ Coverage 77.66% 77.67% +0.01%
============================================
Files 146 146
Lines 88021 88096 +75
============================================
+ Hits 68358 68432 +74
- Misses 19663 19664 +1 🚀 New features to boost your workflow:
|
sundb
approved these changes
Oct 10, 2026
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue
Sentinel can enter a busy loop when a stale Linux socket error queue entry remains after TCP connection succeeds.
Related Issue:
Change
Port hiredis#1375 into
deps/hiredis.Drain the Linux error queue when TCP connect is pending or completed, preserving
errno. Blocking connections continue polling with the remaining original timeout.Add the upstream timestamping regression to verify that
EPOLLERRclears and the connection still readsPONG.Co-authored-by: Steve Wills [email protected]
Note
Medium Risk
Changes core TCP connect completion and blocking wait logic on Linux; behavior is scoped to TCP and matches an upstream hiredis fix with a dedicated regression test.
Overview
Ports upstream hiredis fix for stale Linux TCP socket error-queue entries after non-blocking connect, which could leave
EPOLLERRstuck and drive Sentinel/event-loop busy loops.On Linux TCP sockets, hiredis now drains the error queue (
recvmsgwithMSG_ERRQUEUE) while connect is still in progress and again when connect completes, without clobberingerrno. Blocking connect wait (redisContextWaitReady) is reworked to poll in a loop with a monotonic deadline so the full connect timeout is honored across repeatedpoll/redisCheckConnectDonecycles.Adds a Linux-only regression test that uses
SO_TIMESTAMPINGto queue timestamp errors, assertsredisCheckConnectDoneclearsEPOLLERR, and confirms the connection can still readPONG.Reviewed by Cursor Bugbot for commit 0cb27fd. Bugbot is set up for automated code reviews on this repo. Configure here.