Skip to content

Dev/no lock #2308

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

Merged
merged 2 commits into from
Sep 28, 2022
Merged

Dev/no lock #2308

merged 2 commits into from
Sep 28, 2022

Conversation

kristjanvalur
Copy link
Contributor

@kristjanvalur kristjanvalur commented Jul 27, 2022

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

An asyncio.Lock present around the redis.asyncio.Connection._parser.read_response() is removed. This is not required, since only a single task should be sending/receiving on a single Connection at the same time.
There is no lock around the send() code and
Without a lock around the entire execute_command() (send, and receive) there has been no guarantee that a response is returned which matches the sent command, if more than one task are sending.

A single unittest for concurrent execution was skipped to not run in single-connection mode. This unittest would have also sporadically failed before this PR if the concurrent commands were different. As it happened, all 10 were the exact same ping command and so mismatching requests/responses were never detected.

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #2308 (b5ebada) into master (b5ebada) will not change coverage.
The diff coverage is n/a.

❗ Current head b5ebada differs from pull request most recent head 8d86e87. Consider uploading reports for the commit 8d86e87 to get more accurate results

@@           Coverage Diff           @@
##           master    #2308   +/-   ##
=======================================
  Coverage   92.21%   92.21%           
=======================================
  Files         111      111           
  Lines       28781    28781           
=======================================
  Hits        26539    26539           
  Misses       2242     2242           

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

@kristjanvalur kristjanvalur force-pushed the dev/no-lock branch 3 times, most recently from deb55e4 to ec58410 Compare July 27, 2022 18:38
@kristjanvalur kristjanvalur marked this pull request as ready for review July 29, 2022 07:26
@kristjanvalur
Copy link
Contributor Author

As usual, sporadic CI failures with docker.

@kristjanvalur
Copy link
Contributor Author

This PR, if accepted, will impact #2295 and make it simpler.

@dvora-h dvora-h merged commit 6b3e0b4 into redis:master Sep 28, 2022
@kristjanvalur
Copy link
Contributor Author

🍾

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.

5 participants