-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Version: 2.10.5
Platform: Python 2.7, Ubuntu
This is a very rare occurrence on a very high traffic server but I receive a key error occasionally from here:
self._in_use_connections.remove(connection)
https://github.com/andymccurdy/redis-py/blob/2.10.5/redis/connection.py#L913
I haven't been able to reproduce this in testing or root out the cause.
Theories:
self._available_connections
is a list
so you could append
in the same connection more then once. Then when you try to self._in_use_connections.add(connection)
https://github.com/andymccurdy/redis-py/blob/2.10.5/redis/connection.py#L898
You get no error for using the same connection. Until you try to release _in_use_connections
is a set
so were the add()
multiple times desen't raise an error remove()
will.