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 call/errbacks of replaced tasks #6770
Conversation
This is a bugfix but I think we can land it on master once we sort out 5.1 since it's been broken for a while. :) It'll improve my life but FWICT there are no issues from other users tracking this misbehaviour. |
This pull request introduces 1 alert when merging d8bf93f into 2411504 - view on LGTM.com new alerts:
|
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.
I'll review the integration tests later on.
Please check the build log as we have a genuine test failure, I believe.
I've changed the logic in |
d8bf93f
to
00d5516
Compare
Codecov Report
@@ Coverage Diff @@
## master #6770 +/- ##
==========================================
+ Coverage 70.71% 70.73% +0.01%
==========================================
Files 138 138
Lines 16604 16605 +1
Branches 2094 2094
==========================================
+ Hits 11741 11745 +4
+ Misses 4667 4663 -4
- Partials 196 197 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This pull request introduces 2 alerts and fixes 1 when merging 00d5516 into 2411504 - view on LGTM.com new alerts:
fixed alerts:
|
00d5516
to
ff9f31f
Compare
This pull request introduces 1 alert when merging ff9f31f into 2411504 - view on LGTM.com new alerts:
|
I've reworked the replacement logic entirely now. It could do with a re-review. AFAICT, removing the early |
ff9f31f
to
d705a73
Compare
This now behaves as I expect and we have some new integration tests to catch regressions or misbehaviours. That actually exposed an issue with chord header result ordering which I've also fixed in the commit on the tip of this branch. |
This pull request introduces 1 alert when merging d705a73 into 2411504 - view on LGTM.com new alerts:
|
639ba23
to
1095f05
Compare
This pull request introduces 1 alert and fixes 2 when merging 1095f05 into 2411504 - view on LGTM.com new alerts:
fixed alerts:
|
1095f05
to
1e74fb1
Compare
That last fixup broke a unit test, it (should be) fixed again now. |
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.
LGTM.
This code is much cleaner than before.
Great thanks :) I've just marked this for 5.2 so we can come back and merge it once we drop 5.1 |
I'll mark this as needs rebase to remind me to rebase on top of 5.1 as prep for merge |
1e74fb1
to
fcfbe43
Compare
This pull request introduces 1 alert when merging fcfbe43 into 025bad6 - view on LGTM.com new alerts:
|
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.
rebase please. as it's a bug fix we can land this on 5.1.x as well
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.
rebase please. as it's a bug fix we can land this on 5.1.x as well
This change modifies a bunch of the tests to use unique keys for the `redis_echo` and `redis_count` tasks which are used to validate that callbacks and errbacks are made. We also introduce helper functions for validating that messages/counts are seen to reduce duplicate code.
This change adds some tests to ensure that when a task is replaced, it runs as expected. This exposed a bug where the group index of a task would be lost when replaced with a chain since chains would not pass their `group_index` option down to the final task when applied. This manifested as the results of chords being mis-ordered on the redis backend since the group index would default to `+inf`. Other backends may have had similar issues.
rebased on master |
fcfbe43
to
5370fdb
Compare
This pull request introduces 2 alerts when merging 5370fdb into 536849c - view on LGTM.com new alerts:
|
* style: Remove unused var from canvas unit tests * test: Check task ID re-freeze on replacement * refac: Remove duped task ID preservation logic * test: Rework canvas call/errback integration tests This change modifies a bunch of the tests to use unique keys for the `redis_echo` and `redis_count` tasks which are used to validate that callbacks and errbacks are made. We also introduce helper functions for validating that messages/counts are seen to reduce duplicate code. * fix: Preserve call/errbacks of replaced tasks Fixes #6441 * fix: Ensure replacement tasks get the group index This change adds some tests to ensure that when a task is replaced, it runs as expected. This exposed a bug where the group index of a task would be lost when replaced with a chain since chains would not pass their `group_index` option down to the final task when applied. This manifested as the results of chords being mis-ordered on the redis backend since the group index would default to `+inf`. Other backends may have had similar issues.
* style: Remove unused var from canvas unit tests * test: Check task ID re-freeze on replacement * refac: Remove duped task ID preservation logic * test: Rework canvas call/errback integration tests This change modifies a bunch of the tests to use unique keys for the `redis_echo` and `redis_count` tasks which are used to validate that callbacks and errbacks are made. We also introduce helper functions for validating that messages/counts are seen to reduce duplicate code. * fix: Preserve call/errbacks of replaced tasks Fixes celery#6441 * fix: Ensure replacement tasks get the group index This change adds some tests to ensure that when a task is replaced, it runs as expected. This exposed a bug where the group index of a task would be lost when replaced with a chain since chains would not pass their `group_index` option down to the final task when applied. This manifested as the results of chords being mis-ordered on the redis backend since the group index would default to `+inf`. Other backends may have had similar issues.
Description
This change fixes the handling of callbacks and errbacks on tasks which get replaced to
ensure they get called as expected if the replacement signature succeeds or fails.
Fixes #6441