Repository navigation
fix: allow ioredis to resolve IPv6-only Redis endpoints (#15290) - #15309
PiedPiper911 wants to merge 1 commit into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Hi @danny-avila — just following up on this PR (fix for #15290, IPv6-only Redis endpoints). The Codex review came back clean ("didn't find any major issues"), and the branch is up to date with |
|
Heads up @danny-avila — the Root cause: under the cluster CI step ( Fix ( CI is re-running now — should go green on both the single-node and cluster steps. |
|
Small follow-up: the workflow runs on the new head ( |
…#15290) Rebased onto current dev. `redisClients.ts` has been refactored on dev since this branch was opened (heartbeat module, readonly-replica recovery, keyv script routing), so this is a three-way merge rather than a replay: the insertion is reapplied inside the current `redisOptions` object and the dev refactor is preserved unchanged. The diff against dev is +11 lines, all additions, in `redisClients.ts` and `experimental.js` — nothing removed. ioredis defaults to `family: 4`. On an IPv6 single-stack cluster the Redis hostname has no A record, so connections fail with ENOTFOUND before authentication is even attempted. `family: 0` lets the resolver return either family and lets Node's Happy Eyeballs (autoSelectFamily, default since Node 20) pick, so dual-stack hosts may now connect over IPv6 too. Applied to the single-instance options, the cluster `redisOptions`, and the standalone `flush-cache.js` / `experimental.js` scripts. Note on the previous head: the nine workflows that ran on 5e733fc on Sep 2 all failed with zero jobs, i.e. they failed before any job started, so those were never real test results. This head supersedes them.
5e733fc to
c2d02a0
Compare
|
Rebased onto current The nine red checks on the previous head were not test results. On
I also checked whether dev had already solved this, and it has not. The What the fix is. ioredis defaults to The integration spec asserts the option lands where each client type reads it — One thing I cannot do from here: the workflows on this head will sit at |
Summary
Fixes #15290 — ioredis defaults to IPv4 (
family: 4), which breaks connections on IPv6 single-stack clusters (ENOTFOUND, no A record). Settingfamily: 0on the shared ioredis options allows the resolver to try both address families: IPv4 first (unchanged behavior for existing users), IPv6 fallback for IPv6-only deployments.Change Type
Testing
family: 0is the standard ioredis value to accept either address family (Nodedns.lookupdefault behavior: IPv4 first, IPv6 fallback)ENOTFOUNDredisOptionsused by both single-node and cluster ioredis clients inredisClients.ts.prettierrc) passesTest Configuration:
Checklist