The Fix
pip install celery==4.2
Based on closed celery/celery issue #6772 · 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.
@@ -99,7 +99,7 @@ def __init__(self, id, backend=None,
self.backend = backend or self.app.backend
self.parent = parent
- self.on_ready = promise(self._on_fulfilled)
+ self.on_ready = promise(self._on_fulfilled, weak=True)
self._cache = None
this bug.
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
Option A — Upgrade to fixed release\npip install celery==4.2\nWhen NOT to use: This fix should not be applied if using a version of Celery that does not support weak references.\n\n
Why This Fix Works in Production
- Trigger: AsyncResult memory leak on task producers
- Mechanism: Memory leak occurs due to improper handling of weak references in AsyncResult
- Why the fix works: Restores weak references for bound method promises in AsyncResult to prevent memory leaks. (first fixed release: 4.2).
Why This Breaks in Prod
- Shows up under Python 2.7 in real deployments (not just unit tests).
- Memory leak occurs due to improper handling of weak references in AsyncResult
- Production symptom (often without a traceback): AsyncResult memory leak on task producers
Proof / Evidence
- GitHub issue: #6772
- Fix PR: https://github.com/celery/celery/pull/5332
- First fixed release: 4.2
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.75
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.69
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“closing as its on a EOL version. will reopen if still reproduced in 5.2”
“Hey @hpurohit-pp :wave:, Thank you for opening an issue”
Failure Signature (Search String)
- AsyncResult memory leak on task producers
- AsyncResult memory leak on task producers when producers retrieves task results from redis results backend. We are using redis as broker and results backend.
Copy-friendly signature
Failure Signature
-----------------
AsyncResult memory leak on task producers
AsyncResult memory leak on task producers when producers retrieves task results from redis results backend. We are using redis as broker and results backend.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
AsyncResult memory leak on task producers
AsyncResult memory leak on task producers when producers retrieves task results from redis results backend. We are using redis as broker and results backend.
Minimal Reproduction
- this bug.
Environment
- Python: 2.7
What Broke
Producers experience increased memory usage leading to potential out-of-memory errors.
Why It Broke
Memory leak occurs due to improper handling of weak references in AsyncResult
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==4.2
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/celery/celery/pull/5332
First fixed release: 4.2
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if using a version of Celery that does not support weak references.
Verify Fix
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Track RSS + object counts after deployments; alert on monotonic growth and GC pressure.
- Add a long-running test that repeats the failing call path and asserts stable memory.
Version Compatibility Table
| Version | Status |
|---|---|
| 4.2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.