Skip to content

AttributeError in aioredis.RedisCluster when the connection is lost: 'ConnectionError' object has no attribute 'host' #3815

@klymenkosergiy

Description

@klymenkosergiy

I noticed an unexpected behavior for aioredis.RedisCluster after losing a connection to the cluster node (the maintenance had been started by the service provider):

AttributeError:'ConnectionError' object has no attribute 'host'
File "<venv_path>/lib/python3.11/site-packages/redis/asyncio/cluster.py", line 787, in execute_command
raise e
File "<venv_path>/lib/python3.11/site-packages/redis/asyncio/cluster.py", line 748, in execute_command
target_nodes = await self._determine_nodes(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<venv_path>/lib/python3.11/site-packages/redis/asyncio/cluster.py", line 624, in _determine_nodes
self.nodes_manager.get_node_from_slot(
File "<venv_path>/lib/python3.11/site-packages/redis/asyncio/cluster.py", line 1342, in get_node_from_slot
self._update_moved_slots()
File "<venv_path>/lib/python3.11/site-packages/redis/asyncio/cluster.py", line 1299, in _update_moved_slots
redirected_node = self.get_node(host=e.host, port=e.port)
^^^^^^

Python: 3.11
Redis-py: 6.4.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions