aredis icon indicating copy to clipboard operation
aredis copied to clipboard

spop(): aredis.exceptions.RedisClusterException: Too many connections

Open Pritamhars opened this issue 4 years ago • 1 comments

aredis version: 1.1.8 aioredis version: 1.3.1

We are getting following error related to aredis when calling " js = await redis.spop('queue name')". Please suggest.

Observation: spop is the only operation used when service runs in idle state. https://github.com/NoneGG/aredis/blob/master/aredis/pool.py#L385

 if self.count_all_num_connections(node) >= self.max_connections:
       if self.max_connections_per_node:
             raise RedisClusterException("Too many connection ({0}) for node: {1}"
                                            .format(self.count_all_num_connections(node),
                                                    node['name']))
       raise RedisClusterException("Too many connections")

I think aredis is leaking connections.

getting following error, stack trace: 2021-12-20 06:39:09,882 ERROR worker - failed

Traceback (most recent call last):

File "/usr/local/lib/python3.6/dist-packages/aredis/pool.py", line 504, in get_connection_by_node

connection = self._available_connections.get(node["name"], []).pop()

IndexError: pop from empty list

js = await redis.spop(Scheduler.r_report_q) File "/usr/local/lib/python3.6/dist-packages/aredis/commands/sets.py", line 88, in spop File "/usr/local/lib/python3.6/dist-packages/aredis/utils.py", line 179, in inner File "/usr/local/lib/python3.6/dist-packages/aredis/client.py", line 407, in execute_command File "/usr/local/lib/python3.6/dist-packages/aredis/pool.py", line 506, in get_connection_by_node File "/usr/local/lib/python3.6/dist-packages/aredis/pool.py", line 397, in make_connection aredis.exceptions.RedisClusterException: Too many connections

Pritamhars avatar Dec 20 '21 08:12 Pritamhars

This PR should fix it: https://github.com/NoneGG/aredis/pull/194

Not sure if this project is still being maintained or not. Looks like @NoneGG didn't have any activity in 2021.

NoneGG had no activity during this period.

Hope he is all right.

nickswebsite avatar Jan 03 '22 20:01 nickswebsite