The Fix
pip install celery==4.4.0rc5
Based on closed celery/celery issue #5654 · 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.
@@ -595,10 +595,13 @@ def signature_from_request(self, request=None, args=None, kwargs=None,
kwargs = request.kwargs if kwargs is None else kwargs
options = request.as_execution_options()
+ delivery_info = request.delivery_info or {}
+ priority = delivery_info.get('priority')
+ if priority is not None:
import celery
from kombu import Exchange
from kombu import Queue
class Config:
task_queues = [
Queue('test', Exchange('test'), routing_key='test', queue_arguments={'x-max-priority': 3})
] # yapf: disable
app = celery.Celery('test')
app.config_from_object(Config)
@app.task(bind=True)
def task(self):
print(self.request.delivery_info['priority'])
self.retry(countdown=1)
if __name__ == '__main__':
task.s().apply_async(priority=1, queue='test')
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==4.4.0rc5\nWhen NOT to use: This fix should not be applied if task priority is not required during retries.\n\n
Why This Fix Works in Production
- Trigger: or possible duplicates to this issue as requested by the checklist above.
- Mechanism: Preserves the task priority during a retry, addressing the issue where task priority is lost after self.retry().
- Why the fix works: Preserves the task priority during a retry, addressing the issue where task priority is lost after self.retry(). (first fixed release: 4.4.0rc5).
- If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).
Why This Breaks in Prod
- Triggered by an upgrade/regression window: 52.974357–57.962134 breaks; 4.4.0rc5 is the first fixed release.
- Production symptom (often without a traceback): or possible duplicates to this issue as requested by the checklist above.
Proof / Evidence
- GitHub issue: #5654
- Fix PR: https://github.com/celery/celery/pull/5820
- First fixed release: 4.4.0rc5
- Affected versions: 52.974357–57.962134
- 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.51
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Hi, it looks like the problem could be potentially fixed here: https://github.com/celery/celery/blob/8e34a67bdb95009df759d45c7c0d725c9c46e0f4/celery/app/task.py#L113 One might copy the priority here as well.”
“Sure, give this a try: https://github.com/celery/celery/pull/5820”
Failure Signature (Search String)
- or possible duplicates to this issue as requested by the checklist above.
- task_queues: [<unbound Queue test -> <unbound Exchange test(direct)> -> test>]
Copy-friendly signature
Failure Signature
-----------------
or possible duplicates to this issue as requested by the checklist above.
task_queues: [<unbound Queue test -> <unbound Exchange test(direct)> -> test>]
Error Message
Signature-only (no traceback captured)
Error Message
-------------
or possible duplicates to this issue as requested by the checklist above.
task_queues: [<unbound Queue test -> <unbound Exchange test(direct)> -> test>]
Minimal Reproduction
import celery
from kombu import Exchange
from kombu import Queue
class Config:
task_queues = [
Queue('test', Exchange('test'), routing_key='test', queue_arguments={'x-max-priority': 3})
] # yapf: disable
app = celery.Celery('test')
app.config_from_object(Config)
@app.task(bind=True)
def task(self):
print(self.request.delivery_info['priority'])
self.retry(countdown=1)
if __name__ == '__main__':
task.s().apply_async(priority=1, queue='test')
What Broke
Tasks lose their priority after being retried, leading to unexpected execution order.
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==4.4.0rc5
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/5820
First fixed release: 4.4.0rc5
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be applied if task priority is not required during retries.
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
- Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
- Pin production dependencies and upgrade only with a reproducible test that hits the failing path.
Version Compatibility Table
| Version | Status |
|---|---|
| 52.974357 | Broken |
| 54.062046 | Broken |
| 55.829945 | Broken |
| 55.959481 | Broken |
| 57.832523 | Broken |
| 57.962134 | Broken |
| 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.