-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Bug Fix: Nested Chords Fail When Using django-celery-results with a Redis Backend #9950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
flake8 is not test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Fix nested chords failing with django-celery-results when using a Redis result backend by ensuring GroupResult.restore uses the correct Celery app/backend.
- Pass the current app into GroupResult.restore within RedisBackend.on_chord_part_return.
- Prevents usage of a DisabledBackend during group restoration, fixing AttributeError in nested chord flows.
auvipy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=========================== short test summary info ============================
FAILED t/unit/backends/test_redis.py::test_RedisBackend_chords_complex::test_on_chord_part_return[True] - AssertionError: expected call not found.
Expected: restore('gid1')
Actual: restore('gid1', app=<Celery celery.tests at 0x7f0786f72210>)
FAILED t/unit/backends/test_redis.py::test_RedisBackend_chords_complex::test_on_chord_part_return[False] - AssertionError: expected call not found.
Expected: restore('gid1')
Actual: restore('gid1', app=<Celery celery.tests at 0x7f0786e92180>)
= 2 failed, 3508 passed, 10 skipped, 3 xfailed, 60 warnings, 28958 subtests passed in 141.53s (0:02:21) =
3.12-unit: 185376 C exit 1 (
e65e0a0 to
bf695fc
Compare
|
pytest output The aforementioned errors have been resolved. ==================================================================== 3381 passed, 27 skipped, 3 xfailed, 59 warnings, 28958 subtests passed in 105.40s (0:01:45) ===================================================================== |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9950 +/- ##
==========================================
- Coverage 78.68% 78.68% -0.01%
==========================================
Files 153 153
Lines 19312 19312
Branches 2214 2214
==========================================
- Hits 15196 15195 -1
Misses 3817 3817
- Partials 299 300 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
can you please rebase? can not update the branch as your work is based off the main branch of your fork. |
|
@auvipy, I have rebased as requested. |

Description
I got the following error when trying to execute nested chords while using django-celery-results with a Redis backend.
After investigation, I found that this was because the
GroupResult.restoremethod was using an incorrect Celery app instead of the Celery app that is defined in the Django project. This incorrect app does not have the result backend defined and therefore causes the above error.This is because the
RedisBackend.on_chord_part_returndoes not pass in the correct Celery app toGroupResult.restore.Therefore, I've made this pull request so that
RedisBackend.on_chord_part_returnwill pass in the correct Celery app toGroupResult.restore.This has fixed this bug, and we are now able to run nested chords.
Related Issue
The following issue describes the same bug.
#9006