From 590e7ff18561ea00776dcaacd4bb289c5940e059 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Thu, 2 Jan 2025 13:11:56 +0530 Subject: [PATCH] fix: Ensure that RESP3 is not in use One can set it in conf and it won't work as expected because pubsub format is different --- frappe/utils/redis_wrapper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/utils/redis_wrapper.py b/frappe/utils/redis_wrapper.py index 19be29d49a..9a8615273f 100644 --- a/frappe/utils/redis_wrapper.py +++ b/frappe/utils/redis_wrapper.py @@ -13,6 +13,7 @@ from redis.commands.search import Search import frappe from frappe.utils import cstr +from frappe.utils.data import cint # 5 is faster than default which is 4. # Python uses old protocol for backward compatibility, we don't support anything <3.10. @@ -418,6 +419,9 @@ class _ClientCache: connection_class=_TrackedConnection, _monitor_id=self.monitor_id, ) + protocol = self.redis.get_connection_kwargs().get("protocol") + if cint(protocol) == 3: + frappe.throw("RESP3 is not supported.") self.invalidator_thread = self.run_invalidator_thread() self.local_cache = {} self._conn_retries = 0