diff options
author | Greg Melton <gmelton@gmail.com> | 2022-05-30 05:45:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-30 15:45:42 +0300 |
commit | 48079083a7f6ac1bdd948c03175f9ffd42aa1f6b (patch) | |
tree | 30b29683a558e618ea80b1c68fc8d14498900dd1 /redis/cluster.py | |
parent | 84418d62db0aef3178d5eecec47d5121ce82a1d4 (diff) | |
download | redis-py-48079083a7f6ac1bdd948c03175f9ffd42aa1f6b.tar.gz |
Fix Missing ClusterPipeline Lock (#2190)
* ClusterPipeline needs to initialize self._lock, otherwise a class instance will fail when calling get_redis_connection on the node
* fix bad lint picked up from master
* added change to CHANGES file
* force ci build again
* force ci build again
Diffstat (limited to 'redis/cluster.py')
-rw-r--r-- | redis/cluster.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/redis/cluster.py b/redis/cluster.py index fa1322f..0b9c543 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -754,6 +754,7 @@ class RedisCluster(AbstractRedisCluster, RedisClusterCommands): cluster_error_retry_attempts=self.cluster_error_retry_attempts, read_from_replicas=self.read_from_replicas, reinitialize_steps=self.reinitialize_steps, + lock=self._lock, ) def lock( @@ -1754,6 +1755,7 @@ class ClusterPipeline(RedisCluster): read_from_replicas=False, cluster_error_retry_attempts=5, reinitialize_steps=10, + lock=None, **kwargs, ): """ """ @@ -1776,6 +1778,9 @@ class ClusterPipeline(RedisCluster): kwargs.get("encoding_errors", "strict"), kwargs.get("decode_responses", False), ) + if lock is None: + lock = threading.Lock() + self._lock = lock def __repr__(self): """ """ |