You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: Deadlock encountered when performing a get() call on a Redis connection with client-side caching enabled and the health_check_interval initializer arg non-zero.
redis = redis.Redis(
host=<host>,
port=<port>,
db=<db>,
encoding='utf-8',
protocol=3, # Needing RESP3 protocol for client-side caching -- it is also supposed to be more performant
cache_config=redis.cache.CacheConfig() # Use client-side caching for performance
decode_responses=True,
retry_on_error=True,
retry=redis.retry.Retry(redis.backoff.ExponentialBackoff(), 3),
health_check_interval=1,
)
With my limited understanding of the Redis server and client implementations, it appears that the connection is processing a "PONG" response from the server in addition to a cache invalidation response/notification (i.e., some kind of multi-part response).
Within the connection.CacheProxyConnection class, self._cache_lock is a non-reentrant threading.Lock object. I suspect that changing it to a reentrant threading.RLock object may resolve this issue?
The text was updated successfully, but these errors were encountered:
michael-chaos
changed the title
Redis client-side caching connection get() deadlocks when health_check_interval is non-zero
Redis client-side caching connection deadlocks when health_check_interval is non-zero
Dec 31, 2024
Version: 5.2.1
Platform: Windows 11 WSL -- Ubuntu 22.04.5 LTS (kernel
5.15.167.4-microsoft-standard-WSL2 SMP
)Description: Deadlock encountered when performing a
get()
call on aRedis
connection with client-side caching enabled and thehealth_check_interval
initializer arg non-zero.Stack Trace:
With my limited understanding of the Redis server and client implementations, it appears that the connection is processing a "PONG" response from the server in addition to a cache invalidation response/notification (i.e., some kind of multi-part response).
Within the
connection.CacheProxyConnection
class,self._cache_lock
is a non-reentrantthreading.Lock
object. I suspect that changing it to a reentrantthreading.RLock
object may resolve this issue?The text was updated successfully, but these errors were encountered: