Jump to solution
Verify

The Fix

pip install celery==4.4.2

Based on closed celery/celery issue #6058 · 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.

Jump to Verify Open PR/Commit
@@ -82,7 +82,8 @@ log_policy_t = namedtuple( - 'log_policy_t', ('format', 'description', 'severity', 'traceback', 'mail'), + 'log_policy_t', + ('format', 'description', 'severity', 'traceback', 'mail'),
repro.py
from celery import Celery app = Celery('tasks', broker='pyamqp://guest:guest@localhost:5672') # for rabitmq broker # app = Celery('tasks', broker='redis://localhost:6379/0') for refis broker @app.task def task_example(): s = 'a' * 256 * (10**6) # Create a string of 256MB raise
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 celery==4.4.2\nWhen NOT to use: This fix should not be applied if the application relies on the traceback for debugging.\n\n

Why This Fix Works in Production

  • Trigger: Memory leak after task raise exception
  • Mechanism: A memory leak occurs when an exception is raised in a task due to uncleaned traceback references
  • Why the fix works: Addresses a memory leak issue that occurs when an exception is raised in a task by cleaning up the traceback. (first fixed release: 4.4.2).

Why This Breaks in Prod

  • A memory leak occurs when an exception is raised in a task due to uncleaned traceback references
  • Production symptom (often without a traceback): Memory leak after task raise exception

Proof / Evidence

  • GitHub issue: #6058
  • Fix PR: https://github.com/celery/celery/pull/6024
  • First fixed release: 4.4.2
  • Reproduced locally: No (not executed)
  • Last verified: 2026-02-09
  • Confidence: 0.85
  • Did this fix it?: Yes (upstream fix exists)
  • Own content ratio: 0.64

Discussion

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

“Thanks @joaojunior , this is a very important finding! Note: this could be fixed in PR https://github.com/celery/celery/pull/6024 , would you try reproducing on latest celery…”
@asfaltboy · 2020-05-09 · confirmation · source
“> Note: this could be fixed in PR #6024 , would you try reproducing on latest celery master branch? closing for now as per this.…”
@auvipy · 2021-02-16 · confirmation · source
“@asfaltboy I saw your comments only now. I will try with the code of the PR and also with the master and I return here…”
@joaojunior · 2020-09-23 · source
“> @asfaltboy I saw your comments only now. I will try with the code of the PR and also with the master and I return…”
@auvipy · 2021-01-27 · source

Failure Signature (Search String)

  • Memory leak after task raise exception
  • - [x] I have included all related issues and possible duplicate issues
Copy-friendly signature
signature.txt
Failure Signature ----------------- Memory leak after task raise exception - [x] I have included all related issues and possible duplicate issues

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- Memory leak after task raise exception - [x] I have included all related issues and possible duplicate issues

Minimal Reproduction

repro.py
from celery import Celery app = Celery('tasks', broker='pyamqp://guest:guest@localhost:5672') # for rabitmq broker # app = Celery('tasks', broker='redis://localhost:6379/0') for refis broker @app.task def task_example(): s = 'a' * 256 * (10**6) # Create a string of 256MB raise

What Broke

The application experiences increased memory usage leading to potential crashes or slowdowns.

Why It Broke

A memory leak occurs when an exception is raised in a task due to uncleaned traceback references

Fix Options (Details)

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

pip install celery==4.4.2

When NOT to use: This fix should not be applied if the application relies on the traceback for debugging.

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

First fixed release: 4.4.2

Last verified: 2026-02-09. 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 applied if the application relies on the traceback for debugging.

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

  • 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

VersionStatus
4.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.