summaryrefslogtreecommitdiff
path: root/src/sentinel.c
diff options
context:
space:
mode:
authorDaniel Shih <hotingwow@gmail.com>2016-01-12 17:06:47 +0800
committerDaniel Shih <hotingwow@gmail.com>2016-01-12 17:06:47 +0800
commite6d970534b41825e9b32504b4e80d0039a389d28 (patch)
treeae770a0d61f59b4315e4806c8ac6f04e90dc30b9 /src/sentinel.c
parentc6e508856aca6863e1e9bec5a09367233ac41aa9 (diff)
downloadredis-e6d970534b41825e9b32504b4e80d0039a389d28.tar.gz
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.
Diffstat (limited to 'src/sentinel.c')
-rw-r--r--src/sentinel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index a246a5b37..8a7ceac20 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -3372,6 +3372,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.