Remove use of deprecated argument (cluster_error_retry_attempts) in RedisCluster.pipeline construction of ClusterPipeline by alisaifee · Pull Request #3670 · redis/redis-py (original) (raw)

Unfortunately we can't remove the argument yet.

Hi, @petyaslavova - sorry for the confusion, the PR isn't removing cluster_error_retry_attempts from the definition of ClusterPipeline, it is simply removing the use of it in the RedisCluster.pipeline where the cluster pipeline is currently being constructed as:

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, cluster_error_retry_attempts=self.retry.get_retries(), read_from_replicas=self.read_from_replicas, load_balancing_strategy=self.load_balancing_strategy, reinitialize_steps=self.reinitialize_steps, retry=self.retry, lock=self._lock, transaction=transaction, )

As you can see the assignment of cluster_error_retry_attempt derives it's value from self.retry.get_retries() as well as assigning retry=self.retry. This effectively means that the assignment in this context has no effect since the constructor of ClusterPipeline only considers it when retry is None:

if retry is not None: self.retry = retry else: self.retry = Retry( backoff=ExponentialWithJitterBackoff(base=1, cap=10), retries=cluster_error_retry_attempts, )

For reference, code coverage also shows that this path is not exercised.