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_cluster: fix simultaneous initialize #2231

Merged
merged 1 commit into from
Jun 19, 2022

Conversation

utkarshgupta137
Copy link
Contributor

@utkarshgupta137 utkarshgupta137 commented Jun 14, 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

_initialize should be set to True only after the initialization is complete. Otherwise, it can cause a race condition if the client is executing multiple commands at a time, for eg. in asyncio.gather

- close startup_nodes too during client.close(), in case they are different
@codecov-commenter
Copy link

codecov-commenter commented Jun 14, 2022

Codecov Report

Merging #2231 (eb65f1a) into master (bedf3c8) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2231      +/-   ##
==========================================
- Coverage   91.83%   91.83%   -0.01%     
==========================================
  Files         108      108              
  Lines       27690    27692       +2     
==========================================
+ Hits        25429    25430       +1     
- Misses       2261     2262       +1     
Impacted Files Coverage Δ
redis/asyncio/cluster.py 89.91% <100.00%> (ø)
tests/test_asyncio/test_cluster.py 97.64% <100.00%> (+<0.01%) ⬆️
tests/test_asyncio/test_search.py 98.35% <0.00%> (-0.33%) ⬇️
tests/test_cluster.py 96.91% <0.00%> (ø)
redis/asyncio/connection.py 83.85% <0.00%> (+0.11%) ⬆️

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 bedf3c8...eb65f1a. Read the comment docs.

@dvora-h dvora-h added maintenance Maintenance (CI, Releases, etc) async cluster bug Bug and removed maintenance Maintenance (CI, Releases, etc) labels Jun 19, 2022
@dvora-h dvora-h merged commit 3370298 into redis:master Jun 19, 2022
@utkarshgupta137 utkarshgupta137 mentioned this pull request Oct 31, 2022
6 tasks
@utkarshgupta137 utkarshgupta137 deleted the async_cluster_intialize branch December 1, 2022 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants