Skip to content

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

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
Feb 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions redis/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ def pipeline(self, transaction=None, shard_hint=None):

return ClusterPipeline(
nodes_manager=self.nodes_manager,
commands_parser=self.commands_parser,
startup_nodes=self.nodes_manager.startup_nodes,
result_callbacks=self.result_callbacks,
cluster_response_callbacks=self.cluster_response_callbacks,
Expand Down Expand Up @@ -1598,6 +1599,7 @@ class ClusterPipeline(RedisCluster):
def __init__(
self,
nodes_manager,
commands_parser,
result_callbacks=None,
cluster_response_callbacks=None,
startup_nodes=None,
Expand All @@ -1610,6 +1612,7 @@ def __init__(
log.info("Creating new instance of ClusterPipeline")
self.command_stack = []
self.nodes_manager = nodes_manager
self.commands_parser = commands_parser
self.refresh_table_asap = False
self.result_callbacks = (
result_callbacks or self.__class__.RESULT_CALLBACKS.copy()
Expand All @@ -1627,11 +1630,6 @@ def __init__(
kwargs.get("decode_responses", False),
)

# The commands parser refers to the parent
# so that we don't push the COMMAND command
# onto the stack
self.commands_parser = CommandsParser(super())

def __repr__(self):
""" """
return f"{type(self).__name__}"
Expand Down