Skip to content
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

Apparent get_connection_pool race condition, object has no attribute 'connection_identifier' #213

Open
graemegcox opened this issue May 3, 2023 · 0 comments

Comments

@graemegcox
Copy link

I have long been using django-redis-cache with py-redis and BlockingConnectionPool in production. I see this error a very small fraction of the time.

I suspect that the following lines of code in get_connection_pool() need to be swapped, so that another thread that accesses _connection_pools will not see the connection before the connection_identifier attribute has been added.

self._connection_pools[connection_identifier] = pool
pool.connection_identifier = connection_identifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant