The Fix
pip install celery==4.4.3
Based on closed celery/celery issue #4661 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -709,15 +709,14 @@ def retry(self, args=None, kwargs=None, exc=None, throw=True,
)
- ret = Retry(exc=exc, when=eta or countdown)
+ ret = Retry(exc=exc, when=eta or countdown, is_eager=is_eager, sig=S)
from unittest import mock
with mock.patch(
'celery.app.task.denied_join_result'
) as mocked_task_join_will_block:
mocked_task_join_will_block.__enter__.return_value = None
# run your task as you wish...
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.3\nWhen NOT to use: This fix should not be used if eager execution is not intended.\n\nOption C — Workaround\nwith mock that allows you to run your tests on version `4.3.x`\nWhen NOT to use: This fix should not be used if eager execution is not intended.\n\n
Why This Fix Works in Production
- Mechanism: Changes the eager retry behavior in Celery, allowing tasks to return the eventual value or MaxRetriesExceededError when using self.retry.
- Why the fix works: Changes the eager retry behavior in Celery, allowing tasks to return the eventual value or MaxRetriesExceededError when using self.retry. (first fixed release: 4.4.3).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- Surfaces as: Traceback (most recent call last):
Proof / Evidence
- GitHub issue: #4661
- Fix PR: https://github.com/celery/celery/pull/6109
- First fixed release: 4.4.3
- 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.58
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“This PR https://github.com/celery/celery/pull/6109 resolves this issue as well.”
“since this is marked with the 4.3 milestone, I want to note that this still happens with 4.3. Please let me know if you require…”
“I had the same issue, but I only use always_eager for tests. I made a workaround with mock that allows you to run your tests…”
“Inspired by @jarussi you can simplify the workaround to: Now you can apply it to the entire test case in one shot. The __enter__ lookup…”
Error Message
Stack trace
Error Message
-------------
Traceback (most recent call last):
...
raise RuntimeError(E_WOULDBLOCK)
RuntimeError: Never call result.get() within a task!
See http://docs.celeryq.org/en/latest/userguide/tasks.html#task-synchronous-subtasks
Minimal Reproduction
from unittest import mock
with mock.patch(
'celery.app.task.denied_join_result'
) as mocked_task_join_will_block:
mocked_task_join_will_block.__enter__.return_value = None
# run your task as you wish...
What Broke
Tasks fail to retry, causing unexpected task failures in production environments.
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install celery==4.4.3
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Option C — Workaround Temporary workaround
with mock that allows you to run your tests on version `4.3.x`
Use only if you cannot change versions today. Treat this as a stopgap and remove once upgraded.
Fix reference: https://github.com/celery/celery/pull/6109
First fixed release: 4.4.3
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if eager execution is not intended.
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 |
|---|---|
| 4.4.3 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.