We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2091636 commit 77e8d43Copy full SHA for 77e8d43
redis/asyncio/cluster.py
@@ -1569,9 +1569,10 @@ async def _execute(
1569
raise result
1570
1571
default_cluster_node = client.get_default_node()
1572
+
1573
+ # In some cases, 'client.get_default_node()' may return None. The check below
1574
+ # prevents a potential AttributeError.
1575
if default_cluster_node is not None:
- # Not sure why default_cluster_node is sometimes None; maybe if the object is being
- # closed during an execution? Either way, this avoids a potential AttributeError
1576
default_node = nodes.get(default_cluster_node.name)
1577
if default_node is not None:
1578
# This pipeline execution used the default node, check if we need
0 commit comments