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

[GROW-3134] release already acquired connections, when get_connections raised an exception #3

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

zach-iee
Copy link

@zach-iee zach-iee commented Jun 27, 2023

Pull Request check-list

Please make sure to review and check all of these items:

  • 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)?
  • Was the change added to CHANGES file?

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

Description of change

when writing test for a custom patch that we've made, i found out that we may be leaking connections in the below scenario

scenario:
1. pipeline needs to be executed on multiple nodes (node 1 and node2)
2. obtain a connection for node 1
3. failed to obtain a connection for node 2 due to ConnectionError or TimeoutError
4. repeat 2 and 3 until it succeeds

In the above scenario, the connection on node 1 that we've acquired doesn't get released forever as we lose reference to the connection, when an exception is raised

FYI there may be more connection leaks, but we need to monitor after this gets applied

Please provide a description of the change here.

@zach-iee zach-iee changed the title [GROW-3134] release already acquired connections, when get_connection… [GROW-3134] release already acquired connections, when get_connections raised an exception Jun 27, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.21 🎉

Comparison is base (8a7897c) 92.10% compared to head (433e481) 92.32%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master       #3      +/-   ##
==========================================
+ Coverage   92.10%   92.32%   +0.21%     
==========================================
  Files         119      119              
  Lines       30547    30567      +20     
==========================================
+ Hits        28136    28221      +85     
+ Misses       2411     2346      -65     
Impacted Files Coverage Δ
redis/cluster.py 90.58% <100.00%> (+1.05%) ⬆️
tests/test_cluster.py 96.77% <100.00%> (+0.13%) ⬆️

... and 14 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zach-iee zach-iee requested review from bellatoris and noah-chae June 28, 2023 04:44
@zach-iee zach-iee marked this pull request as ready for review June 28, 2023 04:44
@zach-iee zach-iee merged commit 94bb915 into master Jun 28, 2023
zach-iee added a commit that referenced this pull request Jun 28, 2023
…s raised an exception (#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style

(cherry picked from commit 94bb915)
zach-iee added a commit that referenced this pull request Jun 28, 2023
…s raised an exception (#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style

(cherry picked from commit 94bb915)
zach-iee added a commit that referenced this pull request Jun 28, 2023
…s raised an exception (#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style

(cherry picked from commit 94bb915)
@zach-iee zach-iee deleted the GROW-3134 branch July 3, 2023 06:14
zach-iee added a commit that referenced this pull request Jul 7, 2023
…s raised an exception (#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style

(cherry picked from commit 94bb915)
zach-iee added a commit that referenced this pull request Aug 21, 2023
…s raised an exception (#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style
zach-iee added a commit that referenced this pull request Aug 21, 2023
…s raised an exception (#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style
zach-iee added a commit that referenced this pull request Sep 14, 2023
…s raised an exception (#3)

* [GROW-3134] release already acquired connections, when get_connections raised an exception

* fix style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants