-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix(): preserve group order in replaced signature #9910
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
fix(): preserve group order in replaced signature #9910
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9910 +/- ##
=======================================
Coverage 78.67% 78.67%
=======================================
Files 153 153
Lines 19299 19299
Branches 2570 2570
=======================================
Hits 15184 15184
Misses 3816 3816
Partials 299 299
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
can you please add unit tests to verify the change?
Added a test here fac9593 |
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
This PR fixes a bug where group ordering was not preserved when replacing a task with a group. The fix prevents group_index
from being passed in options to avoid all tasks in the group having the same index, which would make ordering non-deterministic.
- Adds
group_index
parameter to_apply_tasks
method to handle group indexing explicitly - Includes a test case to verify group order preservation when task replacement occurs
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
celery/canvas.py | Adds group_index parameter to _apply_tasks method signature to handle group indexing |
t/unit/tasks/test_canvas.py | Adds test case to verify group order is preserved during task replacement |
I added a second integration test in 1343410
|
Just a small clarification. I said the result ordering depends on the timing of tasks execution. This is not always correct. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
This reverts commit 39385e0. The orignal commit introduced a syntax error.
Note: Before submitting this pull request, please review our contributing
guidelines.
Description
Preserve group ordering when replacing a task with a group.
It should not be allowed to pass a
group_index
in the options, otherwise all tasks in the group will have the samegroup_index
and the ordering is not deterministic.Related issue: #9909