Closed aajay closed 3 years ago
@aajay Is this the same code that upstream redis-py uses for this ready check feature?
@aajay Is this the same code that upstream redis-py uses for this ready check feature?
Yes @Grokzen. Added _check_ready_to_send() similar to redis-py. Apart from this, also fixed two other issues as described in the PR.
@Grokzen Can you please review this PR?
@aajay Is this the same code that upstream redis-py uses for this ready check feature?
Yes @Grokzen. Added _check_ready_to_send() similar to redis-py. Apart from this, also fixed two other issues as described in the PR.
Reference to similar check added in redis-py library - https://github.com/andymccurdy/redis-py/blob/master/redis/connection.py#L1147
@Grokzen Would you be able to help us with this review ?
@aajay I manually implemented this into the code base as i needed to put the check logic elsewhere to mimic the place where redis-py implements it so i added it to the same place and not in the client class
https://github.com/Grokzen/redis-py-cluster/commit/95fee797dac63501f2933c8a0b46d72dbc5250d9
To fix https://github.com/Grokzen/redis-py-cluster/issues/419 add a safety check to ensure there is no stale data before using the connection for executing a command.
Improve error handling to ensure on any error the connection is disconnected before getting released back to the pool.
Set connection to None as on ClusterDownError, the connection pool is reset, so to avoid the dangling connection getting added back to the pool.