diff options
author | Mike Shchurov <mykhailo.shchurov@wolt.com> | 2022-02-22 12:46:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 12:46:45 +0200 |
commit | f2e34739fccab28a28a066a3ece955eb455b32f9 (patch) | |
tree | 70c309b25b8e5d585f21e0a65030c7fff194e60c | |
parent | d56baeb683fc1935cfa343fa2eeb0fa9bd955283 (diff) | |
download | redis-py-f2e34739fccab28a28a066a3ece955eb455b32f9.tar.gz |
FixingElevated CPU utilization on one node when using RedisCluster pipeline (#1985)
-rw-r--r-- | redis/cluster.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/redis/cluster.py b/redis/cluster.py index b594d30..7151cfe 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -712,6 +712,7 @@ class RedisCluster(RedisClusterCommands): 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, @@ -1598,6 +1599,7 @@ class ClusterPipeline(RedisCluster): def __init__( self, nodes_manager, + commands_parser, result_callbacks=None, cluster_response_callbacks=None, startup_nodes=None, @@ -1610,6 +1612,7 @@ class ClusterPipeline(RedisCluster): 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() @@ -1627,11 +1630,6 @@ class ClusterPipeline(RedisCluster): 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__}" |