Skip to content

Redis: patch IPv6 support detection

Jason Plum requested to merge fix-redis-ipv6-nosupport into master

Summary

The Redis codebase has an issue with IPv6, and detecting failure.

Explanation

When provided with no bind address, Redis will attempt to listen on both IPv6 IPv4 localhost, however it only handles EAFNOSUPPORT and not EPROTONOSUPPORT. This can, and does cause Redis to exit on a machine that has no IPv6 protocol, such as most recent releases of dockerd.

I experience this surprise during the building of the gitlab-pivotal/gcp-infra project, but that was with Redis in the same v3.x family but outside our codebase. This time, we found Redis to be a problem when examining ARMv7 builds (RPi 2), and I was reminded of this problem.

Essentially pulled from https://github.com/antirez/redis/issues/3894

The included patch file was originally made against Redis 3.2.8, but applies cleanly with a few lines of fuzz to 3.2.5 (https://github.com/antirez/redis/blob/3.2.8/src/server.c#L1786)

Why does this matter

Unless we explicitly ensure that only those protocols supported by the host system are specific in the redis.conf, we can't ensure that a host system without support for IPv6 will function. Currently this has not bitten us directly. As seen with https://gitlab.com/gitlab-terraform/gce/ being functional, this may not be a high priority. We can not, however, assume that this will be a reliable item without ensuring that proper detection and handling does occur.

See

Edited by Jason Plum

Merge request reports