Skip to content

Update ioredis to support connecting to Redis in IPv6 networks #7326

@alexdaima

Description

@alexdaima

Recently ioredis updated their code in order to default to using an IP family of 0 instead of 4, which means that applications that use it can operate in both IPv4 and IPv6 networks with no extra configuration, the PR for this is:

By altering relevant package.json files (8 in total) in the following way:

- "ioredis": "5.4.2",
+ "ioredis": "5.8.2",

and re-deploying the relevant applications, it can be observed as fixing connection problems to Redis, i.e. going from repeating logs such as:

{"level":30,"time":1764170513189,"pid":7,"hostname":"server-85cd65684f-dln82","source":"RedisSubscribe","msg":"Redis connection closed (label=subscriber)"}
{"level":30,"time":1764170513189,"pid":7,"hostname":"server-85cd65684f-dln82","source":"RedisSubscribe","msg":"Redis reconnecting in 2000 (label=subscriber)"}
{"level":50,"time":1764170513189,"pid":7,"hostname":"server-85cd65684f-dln82","source":"Redis","msg":"Redis connection error (error=Error: getaddrinfo ENOTFOUND xxxxxxxxxxxx, label=Redis)"}

to

{"level":30,"time":1764201827121,"pid":7,"hostname":"server-f57c87464-bbjcq","source":"RedisSubscribe","msg":"Redis connection ready (label=subscriber)"}
{"level":30,"time":1764201827121,"pid":7,"hostname":"server-f57c87464-bbjcq","source":"Redis","msg":"Redis connection ready (label=Redis)"}

I would be happy to provide the PR if needed, but thought better to create the issue here first incase there are any other factors I'm unaware of that means this solution cannot be applied to main.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions