-
Notifications
You must be signed in to change notification settings - Fork 335
Sentinel client ConnectionError "Too many connections" #1173
Comments
@skhayrulin this might be your problem?
Instead, pass in |
Thanks for replying so I've fixed, but problem is still the same
|
Hmm, this is interesting! How are you running redis in this example? Do you have sentinel setup locally, with or without docker, or are you connecting to a remote redis? |
Hello,
|
Hi @skhayrulin, excellent, this should give us enough to reproduce. I’ll try to do that soon and update the ticket with my findings. |
Also got same error when using ConnectionPool. We had to rollback to 1.3.1. Will it be fixed in 2.0.2? |
The The pool in redis_client = aioredis.from_url("redis://127.0.0.1:6379/0", max_connections=2)
tasks = []
for i in range(20):
tasks.append(asyncio.create_task(redis_client.set(str(uuid.uuid4()), 1, ex=20)))
await asyncio.gather(*tasks) The exceptions could be caught and just enter a retry loop, but you never know if the connection really is broken and this also introduces a busy-wait pattern. Because the pool is very willing to open more connections, and does not throttle client requests, the call to You'll need to use something like |
Describe the bug
Hello,
This problem is very similar to this issue only difference is that I'm using Sentinel. As far as I realized I cannot use BlockingConnectionPool as connection_pool_class when run master_for.
To Reproduce
Expected behavior
Use 2 connections in the pool to successfully ping 3 tasks.
Logs/tracebacks
Python Version
Python 3.8.10
aioredis Version
Additional context
Didn't face with such behavior in version 1.3.1
Code of Conduct
The text was updated successfully, but these errors were encountered: