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

Async clusters: Support creating locks inside async functions #2471

Merged
merged 2 commits into from Dec 4, 2022

Conversation

utkarshgupta137
Copy link
Contributor

@utkarshgupta137 utkarshgupta137 commented Nov 24, 2022

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

Description of change

This allows creating the client at the module level or before the event loop has been initialized.
Ref: encode/starlette#1315 (comment)

This allows creating the client at the module level or before the event loop has been initialized.
@utkarshgupta137 utkarshgupta137 changed the base branch from 4.3 to master November 24, 2022 07:34
@utkarshgupta137
Copy link
Contributor Author

@chayim @dvora-h This is a minor fix which should be included in 4.4.0. If it is still far away, I can raise a PR for the 4.3 branch as well.

@codecov-commenter
Copy link

codecov-commenter commented Nov 24, 2022

Codecov Report

Base: 92.22% // Head: 92.21% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (f9363db) compared to base (c48dc83).
Patch coverage: 80.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2471      +/-   ##
==========================================
- Coverage   92.22%   92.21%   -0.01%     
==========================================
  Files         113      113              
  Lines       29321    29325       +4     
==========================================
+ Hits        27042    27043       +1     
- Misses       2279     2282       +3     
Impacted Files Coverage Δ
redis/asyncio/cluster.py 91.68% <80.00%> (-0.11%) ⬇️
tests/test_cluster.py 96.89% <0.00%> (-0.12%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@chayim
Copy link
Contributor

chayim commented Nov 29, 2022

@utkarshgupta137 We're still waiting on #2407 and given your fix.. I'm pretty good with this getting into 4.4 as that merge. Let's give a bit longer (end of week maybe) for your PR in arq, and then we can merge it down + decide.

Does that work for you? I'd really like to not have multiple releases :D

@utkarshgupta137
Copy link
Contributor Author

@utkarshgupta137 We're still waiting on #2407 and given your fix.. I'm pretty good with this getting into 4.4 as that merge. Let's give a bit longer (end of week maybe) for your PR in arq, and then we can merge it down + decide.

Does that work for you? I'd really like to not have multiple releases :D

Sure, it would work for me. But I don't think it is reasonable to wait for a third-party package to fix what is essentially a misuse (undefined behaviour) on their end. For all we know, there could be many other packages out there misusing some functionality of this package...
Also, there are other breaking changes in this release, so ideally, packages using redis as a dependency should have a version cap.

@chayim
Copy link
Contributor

chayim commented Dec 4, 2022

@utkarshgupta137 I randomly head out to the internet and contribute version caps for reasons like this. Part of a general goal of not breaking the community means I was happy to delay in this case, especially with the backport to 4.3.5.

Thanks again for the fix in arq - this goes into 4.4x.

@chayim chayim added the feature New feature label Dec 4, 2022
@chayim chayim changed the title async_cluster: create asyncio.Lock inside async functions Async clusters: Support creating locks inside async functions Dec 4, 2022
@chayim chayim self-requested a review December 4, 2022 07:50
@chayim chayim merged commit a114f26 into redis:master Dec 4, 2022
@utkarshgupta137 utkarshgupta137 deleted the async_cluster_lock branch December 4, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants