diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2016-05-05 17:16:58 +0200 |
---|---|---|
committer | Salvatore Sanfilippo <antirez@gmail.com> | 2016-05-05 17:16:58 +0200 |
commit | f5ff91f675843b132bfee9c0c4b19cc1908cacb9 (patch) | |
tree | 4472b6e0884870abf341f95b33dbd779c29c4215 /src | |
parent | 0c1f84f0ea3d7bdbfd4429814e418db4325441e7 (diff) | |
parent | e6d970534b41825e9b32504b4e80d0039a389d28 (diff) | |
download | redis-f5ff91f675843b132bfee9c0c4b19cc1908cacb9.tar.gz |
Merge pull request #2998 from danielhtshih/unstable
Fix a possible race condition of sdown event detection if sentinel's connection to master/slave/sentinel became disconnected just after the last PONG and before the next PING.
Diffstat (limited to 'src')
-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 da0a400da..0d1eb78aa 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. |