From 27386a6ed989cc25a38a4ff1f48155672c76c688 Mon Sep 17 00:00:00 2001 From: Greg Melton Date: Thu, 19 May 2022 13:51:47 -0700 Subject: [PATCH 1/5] ClusterPipeline needs to initialize self._lock, otherwise a class instance will fail when calling get_redis_connection on the node --- redis/cluster.py | 5 +++++ redis/commands/json/__init__.py | 1 + redis/commands/timeseries/__init__.py | 1 + 3 files changed, 7 insertions(+) diff --git a/redis/cluster.py b/redis/cluster.py index fa1322f103..0b9c543afb 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -754,6 +754,7 @@ def pipeline(self, transaction=None, shard_hint=None): 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 @@ def __init__( read_from_replicas=False, cluster_error_retry_attempts=5, reinitialize_steps=10, + lock=None, **kwargs, ): """ """ @@ -1776,6 +1778,9 @@ def __init__( kwargs.get("encoding_errors", "strict"), kwargs.get("decode_responses", False), ) + if lock is None: + lock = threading.Lock() + self._lock = lock def __repr__(self): """ """ diff --git a/redis/commands/json/__init__.py b/redis/commands/json/__init__.py index 638e4eb166..39983be9cb 100644 --- a/redis/commands/json/__init__.py +++ b/redis/commands/json/__init__.py @@ -113,6 +113,7 @@ def pipeline(self, transaction=True, shard_hint=None): cluster_error_retry_attempts=self.client.cluster_error_retry_attempts, read_from_replicas=self.client.read_from_replicas, reinitialize_steps=self.client.reinitialize_steps, + lock=self.client._lock, ) else: diff --git a/redis/commands/timeseries/__init__.py b/redis/commands/timeseries/__init__.py index 4720a430f8..4a6886f237 100644 --- a/redis/commands/timeseries/__init__.py +++ b/redis/commands/timeseries/__init__.py @@ -77,6 +77,7 @@ def pipeline(self, transaction=True, shard_hint=None): cluster_error_retry_attempts=self.client.cluster_error_retry_attempts, read_from_replicas=self.client.read_from_replicas, reinitialize_steps=self.client.reinitialize_steps, + lock=self.client._lock, ) else: From 4fd4ef642391ad98e5424d75b5e5fb3c5155b89a Mon Sep 17 00:00:00 2001 From: Greg Melton Date: Thu, 19 May 2022 16:14:12 -0700 Subject: [PATCH 2/5] fix bad lint picked up from master --- redis/commands/search/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/commands/search/commands.py b/redis/commands/search/commands.py index 5a9f6fec54..10b57624cd 100644 --- a/redis/commands/search/commands.py +++ b/redis/commands/search/commands.py @@ -167,7 +167,7 @@ def dropindex(self, delete_documents=False): ### Parameters: - **delete_documents**: If `True`, all documents will be deleted. - + For more information see `FT.DROPINDEX `_. """ # noqa keep_str = "" if delete_documents else "KEEPDOCS" From cb0a4da961b3297f8abcd29349b12a265b51ea28 Mon Sep 17 00:00:00 2001 From: Greg Melton Date: Thu, 19 May 2022 16:49:46 -0700 Subject: [PATCH 3/5] added change to CHANGES file --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index f954a07777..b7e238ebb3 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ * Remove verbose logging when initializing ClusterPubSub, ClusterPipeline or RedisCluster * Fix broken connection writer lock-up for asyncio (#2065) * Fix auth bug when provided with no username (#2086) + * Fix missing ClusterPipeline._lock (#2189) * 4.1.3 (Feb 8, 2022) * Fix flushdb and flushall (#1926) From 8b0f065d445f7171b45cf0d2a9e823aaf931947c Mon Sep 17 00:00:00 2001 From: Greg Melton Date: Mon, 23 May 2022 11:01:47 -0700 Subject: [PATCH 4/5] force ci build again From fd73f14bbfd716fe66ade8d98b3318da1022fc63 Mon Sep 17 00:00:00 2001 From: Greg Melton Date: Mon, 23 May 2022 11:19:37 -0700 Subject: [PATCH 5/5] force ci build again