Grokzen / redis-py-cluster

Python cluster client for the official redis cluster. Redis 3.0+.
https://redis-py-cluster.readthedocs.io/
MIT License
1.1k stars 315 forks source link

Add a safety check and improve error handling. #430

Closed aajay closed 3 years ago

aajay commented 3 years ago
Grokzen commented 3 years ago

@aajay Is this the same code that upstream redis-py uses for this ready check feature?

aajay commented 3 years ago

@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.

aajay commented 3 years ago

@Grokzen Can you please review this PR?

AmitANetskope commented 3 years ago

@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

ns-smundle commented 3 years ago

@Grokzen Would you be able to help us with this review ?

Grokzen commented 3 years ago

@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