Skip to content
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

get_connection: catch OSError too #1832

Merged
merged 1 commit into from Jan 10, 2022
Merged

get_connection: catch OSError too #1832

merged 1 commit into from Jan 10, 2022

Conversation

Enchufa2
Copy link
Contributor

@Enchufa2 Enchufa2 commented Dec 24, 2021

which covers built-in ConnectionError, to recover from connection issues such as ConnectionResetError and ConnectionAbortedError. Closes #1772.

Pull Request check-list

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

@codecov-commenter
Copy link

codecov-commenter commented Dec 24, 2021

Codecov Report

Merging #1832 (bdbded7) into master (04b8d34) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1832   +/-   ##
=======================================
  Coverage   94.41%   94.41%           
=======================================
  Files          75       75           
  Lines       16026    16026           
=======================================
  Hits        15131    15131           
  Misses        895      895           
Impacted Files Coverage Δ
redis/connection.py 88.81% <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 04b8d34...bdbded7. Read the comment docs.

@chayim chayim merged commit 41cef47 into redis:master Jan 10, 2022
dvora-h pushed a commit to dvora-h/redis-py that referenced this pull request Jan 11, 2022
Andrew-Chen-Wang added a commit to aio-libs-abandoned/aioredis-py that referenced this pull request Jan 12, 2022
dvora-h pushed a commit to dvora-h/redis-py that referenced this pull request Jan 25, 2022
@elemoine
Copy link
Contributor

Why wasn't this change applied to BlockingConnectionPool as well?

@Enchufa2
Copy link
Contributor Author

Good catch. Maybe that part should be refactored to avoid repeating code, and this kind of problem.

@elemoine
Copy link
Contributor

Good catch. Maybe that part should be refactored to avoid repeating code, and this kind of problem.

Thanks for confirming.

@elemoine
Copy link
Contributor

See #2001 that applies the same change to BlockingConnectionPool.

@hyeongguen-song
Copy link
Contributor

hyeongguen-song commented Oct 7, 2022

Hi, @Enchufa2
Why asyncio.ConnectionPool don't catch OSError?

except ConnectionError:

@Enchufa2
Copy link
Contributor Author

Enchufa2 commented Oct 7, 2022

@hyeongguen-song Because asyncio support was added 8 months ago, but this PR was opened 9 months ago. ;-) So, yeap, this should be ported to asyncio too.

@hyeongguen-song hyeongguen-song mentioned this pull request Oct 7, 2022
6 tasks
@hyeongguen-song
Copy link
Contributor

@hyeongguen-song Because asyncio support was added 8 months ago, but this PR was opened 9 months ago. ;-) So, yeap, this should be ported to asyncio too.

Thanks for reply 😉

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.

Connection pool doesn't recover from aborts or resets
5 participants