Skip to content

Commit ea3ca34

Browse files
rtibblesclaude
andcommitted
fix: force RESP2 default so redis-py 8 works with pinned Redis v4
redis-py 8 defaults connections to RESP3, whose HELLO handshake the deployed Redis v4 server rejects. Override the client-wide default back to RESP2 to cover all connection paths (cache, native RedisCache, kombu). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BYYEYww8xJuFsjkLRbHqsn
1 parent 776a42f commit ea3ca34

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

contentcuration/contentcuration/settings.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@
9696

9797
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
9898

99+
# redis-py 8 defaults to RESP3, whose HELLO handshake the pinned Redis v4
100+
# server rejects. Force RESP2 globally rather than per connection: our paths
101+
# (cache, native RedisCache, kombu broker) set protocol differently and kombu
102+
# exposes no knob for it. Remove once the Redis server is upgraded.
103+
import redis.connection
104+
import redis.utils
105+
106+
redis.connection.DEFAULT_RESP_VERSION = 2
107+
redis.utils.DEFAULT_RESP_VERSION = 2
108+
99109
REDIS_URL = "redis://:{password}@{endpoint}/".format(
100110
password=os.getenv("CELERY_REDIS_PASSWORD") or "",
101111
endpoint=os.getenv("CELERY_BROKER_ENDPOINT") or "localhost:6379",

0 commit comments

Comments
 (0)