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

Add lock to Pubsub.execute_command to ensure only one connection is created #19

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

dlunch
Copy link

@dlunch dlunch commented Sep 26, 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

Please provide a description of the change here.

@dlunch dlunch requested a review from zach-iee September 26, 2023 03:50
@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1032660) 92.40% compared to head (3fc64f2) 92.36%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
- Coverage   92.40%   92.36%   -0.04%     
==========================================
  Files         119      119              
  Lines       30727    30743      +16     
==========================================
+ Hits        28392    28395       +3     
- Misses       2335     2348      +13     
Files Coverage Δ
redis/client.py 89.64% <100.00%> (-0.08%) ⬇️
tests/test_pubsub.py 99.62% <100.00%> (+<0.01%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dlunch
Copy link
Author

dlunch commented Sep 26, 2023

is it better patch it upstream?

@zach-iee
Copy link

is it better patch it upstream?

it would be best to patch the upstream as well as we can remove this PR once upstream release a new release

Also could you please add a test case for this code (ex. lock is already acquired and trying to acquire a connection doesn't return a new connection)?

Copy link

@zach-iee zach-iee left a comment

Choose a reason for hiding this comment

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

i'll review again, when a test is added

@zach-iee
Copy link

@dlunch any update?

@dlunch
Copy link
Author

dlunch commented Oct 25, 2023

Sorry, i was on vacation. i'll add test this week

@dlunch dlunch requested a review from zach-iee October 26, 2023 04:17
@dlunch dlunch force-pushed the fix/connection-leak branch from fa27fe9 to 3fc64f2 Compare October 26, 2023 04:45
Copy link

@zach-iee zach-iee left a comment

Choose a reason for hiding this comment

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

👍
please create a PR to 4.4 branch in order to backmerge

@dlunch dlunch merged commit aa218e3 into master Oct 27, 2023
46 checks passed
@dlunch dlunch deleted the fix/connection-leak branch October 27, 2023 02:55
dlunch added a commit that referenced this pull request Oct 27, 2023
…reated (#19)

* Add lock to Pubsub.execute_command to ensure only one connection is created

* Add tests
dlunch added a commit that referenced this pull request Oct 27, 2023
…reated (#19) (#22)

* Add lock to Pubsub.execute_command to ensure only one connection is created

* Add tests
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.

4 participants