Skip to content

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

Merged
dlunch merged 2 commits into
masterfrom
fix/connection-leak
Oct 27, 2023
Merged

Add lock to Pubsub.execute_command to ensure only one connection is created#19
dlunch merged 2 commits into
masterfrom
fix/connection-leak

Conversation

@dlunch
Copy link
Copy Markdown

@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
Copy Markdown

codecov-commenter commented Sep 26, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.36%. Comparing base (1032660) to head (3fc64f2).
⚠️ Report is 2 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     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dlunch
Copy link
Copy Markdown
Author

dlunch commented Sep 26, 2023

is it better patch it upstream?

@zach-iee
Copy link
Copy Markdown

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
Copy Markdown

@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
Copy Markdown

@dlunch any update?

@dlunch
Copy link
Copy Markdown
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
Copy Markdown

@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
@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
bellatoris pushed a commit that referenced this pull request Jan 28, 2026
…reated (#19) (#22)

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

* Add tests
bellatoris pushed a commit that referenced this pull request Jan 28, 2026
…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