From 83911675cd3b15ed419eeb7d0a17f54adfdfdc2c Mon Sep 17 00:00:00 2001 From: Lucian Balaceanu Date: Tue, 8 May 2018 12:01:20 +0300 Subject: [PATCH] Fix for recovering from losing synchronous redis context while the async one is up Force re-checking of the synchronous redis context state in case of processing a redis notification. It is possible that redis async context is up while the blocking one is down. --- daemon/redis.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/redis.c b/daemon/redis.c index 197a1c430..f90183348 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -346,6 +346,9 @@ void on_redis_notification(redisAsyncContext *actx, void *reply, void *privdata) // now at callid = keyspace_id; + if (redis_check_conn(r) == REDIS_STATE_DISCONNECTED) + goto err; + // select the right db for restoring the call if (redisCommandNR(r->ctx, "SELECT %i", r->db)) { if (r->ctx && r->ctx->err)