Skip to content

Commit

Permalink
asyncio redis cluster: fixed reconnection when whole cluster goes dow…
Browse files Browse the repository at this point in the history
…n and then back online
  • Loading branch information
Adam Žurek committed Jan 14, 2024
1 parent 254c8c0 commit 1c9a19f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redis/asyncio/cluster.py
Expand Up @@ -1114,6 +1114,7 @@ class NodesManager:
"require_full_coverage",
"slots_cache",
"startup_nodes",
"_initial_startup_nodes",
"address_remap",
)

Expand All @@ -1125,6 +1126,7 @@ def __init__(
address_remap: Optional[Callable[[str, int], Tuple[str, int]]] = None,
) -> None:
self.startup_nodes = {node.name: node for node in startup_nodes}
self._initial_startup_nodes = copy.deepcopy(startup_nodes)
self.require_full_coverage = require_full_coverage
self.connection_kwargs = connection_kwargs
self.address_remap = address_remap
Expand Down Expand Up @@ -1247,7 +1249,7 @@ async def initialize(self) -> None:
startup_nodes_reachable = False
fully_covered = False
exception = None
for startup_node in self.startup_nodes.values():
for startup_node in self.startup_nodes.values() or self._initial_startup_nodes.values():
try:
# Make sure cluster mode is enabled on this node
if not (await startup_node.execute_command("INFO")).get(
Expand Down

0 comments on commit 1c9a19f

Please sign in to comment.