redis-py
redis-py copied to clipboard
Add NoReplicasError exception
Pull Request check-list
Please make sure to review and check all of these items:
- [x] Does
$ tox
pass with this change (including linting)? - [x] Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
- [x] Is the new or changed code fully tested?
- [x] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.
Description of change
Add NoReplicasError exception.
During redis failover server can send NOREPLICAS Not enough good replicas to write.
response. Redis server does not accept redis write command in this case. See: https://github.com/redis/redis/blob/ec582cc7ad0706e252bc905822226e49f4c4d0e4/src/server.c#L4118
So it is safe to retry.
We would like to catch this exception and retry write command.
This pull request is marked stale. It will be closed in 30 days if it is not updated.
Codecov Report
Merging #1502 (514b1c5) into master (a246f40) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #1502 +/- ##
=======================================
Coverage 92.00% 92.00%
=======================================
Files 109 109
Lines 28068 28074 +6
=======================================
+ Hits 25823 25829 +6
Misses 2245 2245
Impacted Files | Coverage Δ | |
---|---|---|
redis/connection.py | 86.42% <ø> (ø) |
|
redis/exceptions.py | 98.55% <100.00%> (+0.04%) |
:arrow_up: |
tests/test_connection_pool.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update a246f40...514b1c5. Read the comment docs.
This pull request is marked stale. It will be closed in 30 days if it is not updated.