TimeoutError: Timed out closing connection after None
Olegt0rr opened this issue · 3 comments
Describe the bug
After switch to aioredis
v2 start to receiving an error:
TimeoutError: Timed out closing connection after None
The same code on <2
dependency works without any errors!
Average redis load ~2.5k RPS
Redis server working via SaaS and has no troubles with availability and resources
To Reproduce
Don't know how...
Expected behavior
aioredis works fine similar to the previous version
Logs/tracebacks
TimeoutError: Timed out closing connection after None
...
File "aiogram/contrib/fsm_storage/redis.py", line 265, in get
return await self._redis.get(name, **kwargs)
File "aioredis/client.py", line 1082, in execute_command
conn = self.connection or await pool.get_connection(command_name, **options)
File "aioredis/connection.py", line 1425, in get_connection
await connection.disconnect()
File "aioredis/connection.py", line 812, in disconnect
raise TimeoutError(
Python Version
$ python --version
CPython
3.9.10(3.9.10 (main, Jan 29 2022, 04:19:45)
[GCC 10.2.1 20210110])
aioredis Version
$ python -m pip show aioredis
2.0.1
Additional context
No response
Code of Conduct
- I agree to follow the aio-libs Code of Conduct
Workaround
To avoid this exception I limit connections amount with max_connections
.
But it's not a solution for this behaviour
Does the problem still occur on master branch? I suspect you're not disconnecting the connection pool (on master, it should be auto disconnecting when you call Redis.disconnect)
@Andrew-Chen-Wang,
can't test this behaviour in my production anymore, cause it was butthurt for me
As soon as new version will be released, it will be implemented on my staging and the I'll try to check it with my testers.
Thanks for response!