Skip to content

Retry on error exception and timeout fixes #1821

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 2 commits into from
Dec 23, 2021
Merged

Conversation

barshaul
Copy link
Contributor

@barshaul barshaul commented Dec 21, 2021

…onError import

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

  1. Added timeout error to the list of errors to retry.
  2. Changed TimeoutError import from redis.exception to RedisTimeoutError so python's TimeoutError won't get override, as it can be also thrown when we try to establish a connection.
  3. A ConnectionError import was added from redis.exceptions, since it was mistakenly not imported and the default ConnectionError was being used.
  4. Increased sleep time to 0.25sec when ClusterDownError is thrown, so it will let more time for the cluster to get healed.

@codecov-commenter
Copy link

codecov-commenter commented Dec 21, 2021

Codecov Report

Merging #1821 (c58d82b) into master (4831034) will increase coverage by 0.07%.
The diff coverage is 91.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1821      +/-   ##
==========================================
+ Coverage   94.32%   94.40%   +0.07%     
==========================================
  Files          75       75              
  Lines       15783    15771      -12     
==========================================
+ Hits        14887    14888       +1     
+ Misses        896      883      -13     
Impacted Files Coverage Δ
redis/cluster.py 92.13% <88.23%> (+1.83%) ⬆️
tests/test_cluster.py 98.79% <100.00%> (-0.01%) ⬇️
tests/conftest.py 90.14% <0.00%> (-0.99%) ⬇️

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 4831034...c58d82b. Read the comment docs.

@barshaul barshaul marked this pull request as ready for review December 21, 2021 10:51
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.

TimeoutError vs RedisTimeoutError - see below.

…xceptions.timeout.

Increased default retries on cluster error.
@chayim chayim added the bug Bug label Dec 23, 2021
@chayim chayim changed the title RedisCluster: Retry on error changes & fixes Retry on error exception and timeout fixes Dec 23, 2021
@chayim chayim merged commit 3347888 into redis:master Dec 23, 2021
@chayim chayim deleted the error_retry branch December 23, 2021 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants