Jump to solution
Verify

The Fix

pip install redis==7.1.0

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

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -1098,6 +1098,7 @@ def lock( timeout=None, sleep=0.1, + blocking=True, blocking_timeout=None, lock_class=None,
repro.py
try: with … pass # do stuff except: pass # handle errors
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install redis==7.1.0\nWhen NOT to use: Do not use this fix if you require the original blocking behavior of the lock.\n\n

Why This Fix Works in Production

  • Trigger: Question: why is `blocking` missing as a lock() parameter?
  • Mechanism: The 'blocking' parameter was missing from the lock() function, causing inconsistency with the Lock class
  • Why the fix works: Added the missing 'blocking' parameter to the lock() function to make it consistent with the Lock class. (first fixed release: 7.1.0).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • The 'blocking' parameter was missing from the lock() function, causing inconsistency with the Lock class
  • Production symptom (often without a traceback): Question: why is `blocking` missing as a lock() parameter?

Proof / Evidence

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

Discussion

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

“Hello @jenstroeger! Maybe @chayim could answer your question. I am also interested and ready to step in if needed.”
@WisdomPill · 2022-02-02 · source
“> We could probably add that”
@jenstroeger · 2020-05-29 · source
“This issue is marked stale. It will be closed in 30 days if it is not updated.”
@github-actions · 2021-05-30 · source
“> I assume that it's an oversight that the blocking arg is missing from Redis.lock(). We could probably add that. @andymccurdy, want a PR?”
@jenstroeger · 2021-05-31 · source

Failure Signature (Search String)

  • Question: why is `blocking` missing as a lock() parameter?
  • why is that same parameter missing from the `lock()` function:
Copy-friendly signature
signature.txt
Failure Signature ----------------- Question: why is `blocking` missing as a lock() parameter? why is that same parameter missing from the `lock()` function:

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Question: why is `blocking` missing as a lock() parameter? why is that same parameter missing from the `lock()` function:

Minimal Reproduction

repro.py
try: with … pass # do stuff except: pass # handle errors

What Broke

Users were unable to use non-blocking locks, leading to potential deadlocks in their applications.

Why It Broke

The 'blocking' parameter was missing from the lock() function, causing inconsistency with the Lock class

Fix Options (Details)

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

pip install redis==7.1.0

When NOT to use: Do not use this fix if you require the original blocking behavior of the lock.

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/2137

First fixed release: 7.1.0

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

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use this fix if you require the original blocking behavior of the lock.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

Did This Fix Work in Your Case?

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

Prevention

  • Add a stress test that runs high-concurrency workloads and fails on thread dumps / blocked locks.
  • Enable watchdog dumps in prod (faulthandler, thread dump endpoint) to capture deadlocks quickly.

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.