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

FixingElevated CPU utilization on one node when using RedisCluster pipeline #1985

Merged
merged 2 commits into from
Feb 22, 2022

Conversation

shchurov
Copy link
Contributor

@shchurov shchurov commented Feb 14, 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)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

This PR addresses the issue #1932.
The current implementation creates a new instance of CommandsParser for every ClusterPipeline instance. It may get expensive because CommandsParser executes COMMAND command during the initialization. I assume that pipelines can reuse the parser instance from RedisCluster instead.

@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2022

Codecov Report

Merging #1985 (a4ed092) into master (aafa7f1) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1985      +/-   ##
==========================================
- Coverage   93.04%   93.03%   -0.02%     
==========================================
  Files          77       77              
  Lines       16603    16603              
==========================================
- Hits        15449    15447       -2     
- Misses       1154     1156       +2     
Impacted Files Coverage Δ
redis/cluster.py 92.42% <100.00%> (ø)
tests/test_cluster.py 98.16% <0.00%> (-0.13%) ⬇️

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 aafa7f1...a4ed092. Read the comment docs.

@chayim chayim added the bug Bug label Feb 22, 2022
@chayim
Copy link
Contributor

chayim commented Feb 22, 2022

Awesome @shchurov thank you for the PR and for fixing the bug you reported. I just merged in the latest master- it all passes, and we'll merge this in.

@chayim chayim changed the title Reuse CommandsParser from RedisCluster in ClusterPipeline FixingElevated CPU utilization on one node when using RedisCluster pipeline Feb 22, 2022
@chayim chayim merged commit f2e3473 into redis:master Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants