summaryrefslogtreecommitdiff
path: root/redis/sentinel.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/sentinel.py')
-rw-r--r--redis/sentinel.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/redis/sentinel.py b/redis/sentinel.py
index bbc4cf5..2b212ea 100644
--- a/redis/sentinel.py
+++ b/redis/sentinel.py
@@ -108,6 +108,9 @@ class SentinelConnectionPool(ConnectionPool):
if self.is_master:
if self.master_address != master_address:
self.master_address = master_address
+ # disconnect any idle connections so that they reconnect
+ # to the new master the next time that they are used.
+ self.disconnect(inuse_connections=False)
return master_address
def rotate_slaves(self):