From 3e45567368fc0cbcc0290c73628b1384484845bf Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 27 Apr 2021 12:27:48 +0200 Subject: [PATCH] config.Redis#NewClient(): work-around go-redis/redis#1737 ... by re-trying once more often than there are connections in the pool. --- pkg/config/redis.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/config/redis.go b/pkg/config/redis.go index 4a623c5f..5f3dd4dd 100644 --- a/pkg/config/redis.go +++ b/pkg/config/redis.go @@ -33,6 +33,10 @@ func (r *Redis) NewClient(logger *zap.SugaredLogger) (*icingaredis.Client, error ReadTimeout: r.Timeout, }) + opts := c.Options() + opts.MaxRetries = opts.PoolSize + 1 // https://github.com/go-redis/redis/issues/1737 + c = redis.NewClient(opts) + return icingaredis.NewClient(c, logger, &r.Options), nil }