Jump to solution
Details

The Fix

pip install redis==7.1.0

Based on closed redis/redis-py issue #935 · PR/commit linked

Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.

Open PR/Commit
@@ -0,0 +1,105 @@ @@ -0,0 +1,105 @@ +from abc import ABC, abstractmethod +import random +
fix.md
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: This fix should not be used if the application requires strict read/write separation.\n\n

Why This Fix Works in Production

  • Trigger: Reconnect to redis if got ReadOnlyError | sentinel
  • Mechanism: The Redis client does not handle ReadOnlyError during master-slave failover properly
  • Why the fix works: Adds a retry mechanism with backoff to handle ReadOnlyError in Redis commands. (first fixed release: 7.1.0).
Production impact:
  • If left unfixed, retry loops can amplify load and turn a small outage into a cascade (thundering herd).

Why This Breaks in Prod

  • The Redis client does not handle ReadOnlyError during master-slave failover properly
  • Surfaces as: Reconnect to redis if got ReadOnlyError | sentinel

Proof / Evidence

  • GitHub issue: #935
  • Fix PR: https://github.com/redis/redis-py/pull/1494
  • First fixed release: 7.1.0
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-08
  • Confidence: 0.85
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.86

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“This issue is marked stale. It will be closed in 30 days if it is not updated.”
@github-actions · 2020-06-30 · source
“Not only about the use of sentinel, for example during failover process, the master node will also changes to replica, and if you use DNS…”
@axot · 2022-02-10 · source

Failure Signature (Search String)

  • Reconnect to redis if got ReadOnlyError | sentinel

Error Message

Stack trace
error.txt
Error Message ------------- Reconnect to redis if got ReadOnlyError | sentinel

What Broke

Clients experience ReadOnlyError when attempting to write to a replica during failover.

Why It Broke

The Redis client does not handle ReadOnlyError during master-slave failover properly

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install redis==7.1.0

When NOT to use: This fix should not be used if the application requires strict read/write separation.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/redis/redis-py/pull/1494

First fixed release: 7.1.0

Last verified: 2026-02-08. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • This fix should not be used if the application requires strict read/write separation.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Make timeouts explicit and test them (unit + integration) to avoid silent behavior changes.
  • Instrument retries (attempt count + reason) and alert on spikes to catch dependency slowdowns.

Version Compatibility Table

VersionStatus
7.1.0 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.