Skip to content

Support for specifying error types with retry #1817

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

Merged
merged 4 commits into from
Dec 23, 2021

Conversation

barshaul
Copy link
Contributor

@barshaul barshaul commented Dec 18, 2021

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)?
  • [X ] Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

The current client implementation supports only retry on TimeoutError.
Added support for passing specific error types to use with the retry mechanism.
The 'retry_on_timeout' argument has not changed for backward compatibility.
Closes #1764

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2021

Codecov Report

Merging #1817 (15d0ada) into master (18c6809) will decrease coverage by 0.33%.
The diff coverage is 97.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1817      +/-   ##
==========================================
- Coverage   94.29%   93.96%   -0.34%     
==========================================
  Files          75       75              
  Lines       15783    15328     -455     
==========================================
- Hits        14883    14403     -480     
- Misses        900      925      +25     
Impacted Files Coverage Δ
redis/client.py 89.75% <75.00%> (-0.22%) ⬇️
redis/cluster.py 90.22% <85.71%> (-0.08%) ⬇️
redis/connection.py 88.78% <100.00%> (+0.08%) ⬆️
redis/retry.py 95.65% <100.00%> (-4.35%) ⬇️
tests/test_retry.py 100.00% <100.00%> (ø)
tests/test_ssl.py 85.71% <0.00%> (-5.96%) ⬇️
redis/__init__.py 85.71% <0.00%> (-4.77%) ⬇️
tests/test_graph_utils/test_edge.py 93.93% <0.00%> (-3.36%) ⬇️
tests/test_graph.py 87.39% <0.00%> (-2.53%) ⬇️
... and 36 more

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 18c6809...15d0ada. Read the comment docs.

@barshaul barshaul changed the title Retry on error Added support for passing specific error types to use with the retry mechanism Dec 18, 2021
@barshaul barshaul marked this pull request as ready for review December 18, 2021 12:22
…on of the nodes manager to stop iterating through startup nodes when the coverage is full
Copy link
Contributor

@chayim chayim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Given the new retry_on_error having a list value, I really think it's default should be at least, an empty list (see inline).

@chayim chayim added the feature New feature label Dec 23, 2021
@chayim chayim changed the title Added support for passing specific error types to use with the retry mechanism Support for specifying error types with retry Dec 23, 2021
@chayim chayim merged commit ddc51c4 into redis:master Dec 23, 2021
@chayim chayim deleted the retry_on_error branch December 23, 2021 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting ReadOnly error when writing data to AWS elastic cache while the cluster is vertically scaled
3 participants