diff options
author | Daniel Shih <hotingwow@gmail.com> | 2016-01-12 17:06:47 +0800 |
---|---|---|
committer | Daniel Shih <hotingwow@gmail.com> | 2016-01-12 17:06:47 +0800 |
commit | e6d970534b41825e9b32504b4e80d0039a389d28 (patch) | |
tree | ae770a0d61f59b4315e4806c8ac6f04e90dc30b9 /src/sentinel.c | |
parent | c6e508856aca6863e1e9bec5a09367233ac41aa9 (diff) | |
download | redis-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.c | 2 |
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. |