Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
fix: Don't explode with ConnectionError when a master is down during …
Browse files Browse the repository at this point in the history
…initialize

Fixes #211
  • Loading branch information
mattrobenolt authored and Grokzen committed Mar 3, 2018
1 parent 7723fe0 commit 978c85c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions rediscluster/nodemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,13 @@ def cluster_require_full_coverage(self, nodes_cache):
nodes = nodes_cache or self.nodes

def node_require_full_coverage(node):
r_node = self.get_redis_link(host=node["host"], port=node["port"], decode_responses=True)
return "yes" in r_node.config_get("cluster-require-full-coverage").values()
try:
r_node = self.get_redis_link(host=node["host"], port=node["port"], decode_responses=True)
return "yes" in r_node.config_get("cluster-require-full-coverage").values()
except ConnectionError:
return False
except Exception:
raise RedisClusterException("ERROR sending 'config get cluster-require-full-coverage' command to redis server: {0}".format(node))

# at least one node should have cluster-require-full-coverage yes
return any(node_require_full_coverage(node) for node in nodes.values())
Expand Down

0 comments on commit 978c85c

Please sign in to comment.