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:
|
|
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. |
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:
|
auvipy
left a comment
There was a problem hiding this comment.
rebase please. as it's a bug fix we can land this on 5.1.x as well
auvipy
left a comment
There was a problem hiding this comment.
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 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