From d9dc0d777b775f2fe4f23f42e1b4130f4de1ed72 Mon Sep 17 00:00:00 2001 From: Daniel Shih Date: Tue, 12 Jan 2016 17:06:47 +0800 Subject: [PATCH] Fix a possible race condition of sdown detection if the connection to master/slave/sentinel decames disconnected just after the last PONG and before the next PING. --- src/sentinel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sentinel.c b/src/sentinel.c index da0a400d..0d1eb78a 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -3387,6 +3387,8 @@ void sentinelCheckSubjectivelyDown(sentinelRedisInstance *ri) { if (ri->link->act_ping_time) elapsed = mstime() - ri->link->act_ping_time; + else if (ri->link->disconnected) + elapsed = mstime() - ri->link->last_avail_time; /* Check if we are in need for a reconnection of one of the * links, because we are detecting low activity.