The Fix
pip install celery==5.5.0
Based on closed celery/celery issue #9446 · PR/commit linked
Production note: Watch p95/p99 latency and retry volume; timeouts can turn into retry storms and duplicate side-effects.
@@ -527,7 +527,8 @@ def revoke_by_stamped_headers(self, headers, destination=None, terminate=False,
for host in result:
for response in host.values():
- task_ids.update(response['ok'])
+ if isinstance(response['ok'], set):
+ task_ids.update(response['ok'])
app.control.revoke_by_stamped_headers(
{"myheader": ["myvalue"]},
terminate=False,
reply=True,
timeout=5,
)
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install celery==5.5.0\nWhen NOT to use: Do not use this fix if the revoke method needs to handle multiple headers differently.\n\n
Why This Fix Works in Production
- Trigger: Invalid task IDs were revoked, leading to gibberish responses from the method call.
- Mechanism: The method attempted to revoke invalid task IDs when no current worker tasks matched the header
- Why the fix works: Fixed a bug in `revoke_by_stamped_headers` that caused invalid task IDs to be revoked when no current worker tasks matched the header. (first fixed release: 5.5.0).
- If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).
Why This Breaks in Prod
- The method attempted to revoke invalid task IDs when no current worker tasks matched the header
- Production symptom (often without a traceback): Invalid task IDs were revoked, leading to gibberish responses from the method call.
Proof / Evidence
- GitHub issue: #9446
- Fix PR: https://github.com/celery/celery/pull/9575
- First fixed release: 5.5.0
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.67
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“These lines here: https://github.com/celery/celery/blob/e3eaa675ee1e48d03a018f0abe763cc1dfb380a5/celery/app/control.py#L527-L530 are problematic, because host.values() contains something like {'ok': "headers {'myheader': ['myvalue']} flagge”
Failure Signature (Search String)
- Invalid task IDs were revoked, leading to gibberish responses from the method call.
Copy-friendly signature
Failure Signature
-----------------
Invalid task IDs were revoked, leading to gibberish responses from the method call.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Invalid task IDs were revoked, leading to gibberish responses from the method call.
Minimal Reproduction
app.control.revoke_by_stamped_headers(
{"myheader": ["myvalue"]},
terminate=False,
reply=True,
timeout=5,
)
What Broke
Invalid task IDs were revoked, leading to gibberish responses from the method call.
Why It Broke
The method attempted to revoke invalid task IDs when no current worker tasks matched the header
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==5.5.0
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/9575
First fixed release: 5.5.0
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not use this fix if the revoke method needs to handle multiple headers differently.
Verify Fix
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
- 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
| Version | Status |
|---|---|
| 5.5.0 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.