-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when reusing asyncio connection pool - multiple event loops #3351
Comments
This is my redis semaphore class |
ohnoah
changed the title
Using the same connection pool across multiple event loops
Error when reusing asyncio connection pool - multiple event loops
Aug 9, 2024
This looks related to Django potentially and running locally. Let me investigate further |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using django and the asyncio Redis client. I want to share a connection pool across my requests. Thus, I initialize the connection pool centrally in my Django settings. I'm using Redis as a distributed semaphore for one of my routes. However, when I have two concurrent requests running, I get an error about
got Future <Future pending> attached to a different loop
. THis does not happen if I initialize a Redis client for each call to this semaphore. It seems to be some issue with reusing the connection pool across event loops. How would I go about doing this? I don't want to create one connection per call, since this is a distributed semaphore that gets called a lot.Version: What redis-py and what redis version is the issue happening on?
5.0.6
Platform: What platform / version? (For example Python 3.5.1 on Windows 7 / Ubuntu 15.10 / Azure)
Mac OS. Python 3.11
Description: Description of your issue, stack traces from errors and code that reproduces the issue
The text was updated successfully, but these errors were encountered: