Jump to solution
Verify

The Fix

pip install celery==4.4.0rc5

Based on closed celery/celery issue #5574 · 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
@@ -392,10 +392,6 @@ def __or__(self, other): # I'm sure, but for now we have this. if isinstance(self, group): - if isinstance(other, group): - # group() | group() -> single group - return group(
repro.py
# myapp.py from celery import Celery app = Celery( 'myapp', broker='amqp://guest@localhost//', backend='redis://localhost:6379/0' ) @app.task def b(zz): import time print('start: {}'.format(zz)) time.sleep(5) print('end: {}'.format(zz)) return zz @app.task def a(zz): print(zz) return zz if __name__ == '__main__': app.start()
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.0rc5\nWhen NOT to use: This fix should not be applied if the task execution order is intentionally designed to allow concurrency.\n\n

Why This Fix Works in Production

  • Trigger: - [x] I have included all related issues and possible duplicate issues
  • Mechanism: The group function incorrectly allowed tasks of group2 to run while tasks of group1 were still executing
  • Why the fix works: Fixes the issue where tasks of group2 run while tasks of group1 are still executing by correcting the behavior of the group function. (first fixed release: 4.4.0rc5).
Production impact:
  • If left unfixed, failures can be intermittent under concurrency (hard to reproduce; shows up as sporadic 5xx/timeouts).

Why This Breaks in Prod

  • The group function incorrectly allowed tasks of group2 to run while tasks of group1 were still executing
  • Production symptom (often without a traceback): - [x] I have included all related issues and possible duplicate issues

Proof / Evidence

  • GitHub issue: #5574
  • Fix PR: https://github.com/celery/celery/pull/5613
  • First fixed release: 4.4.0rc5
  • 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.61

Discussion

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

“Yes, I did try it from master. Actually, I have a question for the source code in the file celery.canvas.Signature#__or__, maybe the comment # group()…”
@tothegump · 2019-06-22 · source
“> There's another related issue here: #2573. > It's the source of this problem... I tried cases in the discussions, and worked fine after this…”
@tothegump · 2019-06-23 · source
“#5615 add integration test to that complex case.”
@tothegump · 2019-06-23 · source

Failure Signature (Search String)

  • - [x] I have included all related issues and possible duplicate issues
  • or possible duplicates to this issue as requested by the checklist above.
Copy-friendly signature
signature.txt
Failure Signature ----------------- - [x] I have included all related issues and possible duplicate issues or possible duplicates to this issue as requested by the checklist above.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- - [x] I have included all related issues and possible duplicate issues or possible duplicates to this issue as requested by the checklist above.

Minimal Reproduction

repro.py
# myapp.py from celery import Celery app = Celery( 'myapp', broker='amqp://guest@localhost//', backend='redis://localhost:6379/0' ) @app.task def b(zz): import time print('start: {}'.format(zz)) time.sleep(5) print('end: {}'.format(zz)) return zz @app.task def a(zz): print(zz) return zz if __name__ == '__main__': app.start()

What Broke

Tasks from group2 were executed concurrently with tasks from group1, leading to unexpected behavior.

Why It Broke

The group function incorrectly allowed tasks of group2 to run while tasks of group1 were still executing

Fix Options (Details)

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

pip install celery==4.4.0rc5

When NOT to use: This fix should not be applied if the task execution order is intentionally designed to allow concurrency.

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

First fixed release: 4.4.0rc5

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 task execution order is intentionally designed to allow concurrency.

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
4.4.0rc5 Fixed

Related Issues

No related fixes found.

Sources

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