Repository navigation
fix: Error propagation and errback calling for group-like signatures - #6746
Conversation
|
This PR is blocked by #6733 since it tests some behaviours affected by that bug and the branch up for merge here contains a merge of that one to get the tests green. |
|
Unit test failures noted, they're due to dumb mocking somewhere unrelated. I'll sort that out this afternoon. |
|
@maxfenv and @msci-jordancrawford - if you have time, could you please look over the changes here and let me know if I've butchered anything improperly or if you have any other concerns with the changeset? Any input would be welcomed :) |
|
This pull request introduces 2 alerts and fixes 1 when merging 63d5ae6 into 230c9ac - view on LGTM.com new alerts:
fixed alerts:
|
63d5ae6 to
da28da9
Compare
Codecov Report
@@ Coverage Diff @@
## master #6746 +/- ##
==========================================
- Coverage 70.66% 70.61% -0.06%
==========================================
Files 138 138
Lines 16566 16585 +19
Branches 2082 2086 +4
==========================================
+ Hits 11706 11711 +5
- Misses 4665 4678 +13
- Partials 195 196 +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 1 alert and fixes 1 when merging da28da9 into 230c9ac - view on LGTM.com new alerts:
fixed alerts:
|
|
Patch coverage seems a bit suspicious, I think the lines it Edit: Oh, perhaps coverage is only being measured for the unit tests? The new lines are only hit by integration tests I think |
|
massive! |
| from time import sleep | ||
|
|
||
| import pytest | ||
| import pytest_subtests # noqa: F401 |
There was a problem hiding this comment.
Why do we need this?
| import pytest_subtests # noqa: F401 |
There was a problem hiding this comment.
This is for the side-effect which allows us to use the subtests fixture. I could do something like
import pytests_subtests as _side_effect # noqa: F401to make that more obvious perhaps. I just ^c^ved this from the other test suite where we use subtests.
thedrow
left a comment
There was a problem hiding this comment.
This looks great.
Could you please run isort on this patch?
Fixes #6220 Co-authored-by: Maximilian Friedersdorff <[email protected]> Co-authored-by: maybe-sybr <[email protected]>
Giving a linked task callback to the 0th task in a group is fine, but for errbacks it's not an appropriate choice since any task in the group could fail. This ensures that if any task other than the 0th one fails, the errback will be called. This opens the possibility for an errback to be called more than once when linked to a group, but generally we expect that they should be design to be idempotent so no warning is issued for the changed behaviour.
These tests simply encode the currently expected behaviour where errbacks linked to a group will be called once for each failed task, as well as the consequences for chords which turn their header into a group if it is not one already.
da28da9 to
2f3faf9
Compare
|
@thedrow - rebased and this should be okay to merge unless you have any reason to not resolve the two outstanding threads. I've added a bit of documentation to cover what @maxfenv and I spoke about above, basically pointing out that group call/errbacks are a bit odd since groups don't really exist and chords implement better behaviour. I'll check back on CI here shortly to avoid blocking on that being red. Do we need to land this in a b3 or shall we just aim for rc1? Edit: Coverage is complaining about stuff which is only covered under the integration tests so I think it's okay. I've been running the tests against a redis broker/backend here and they seem quite happy. |
|
This pull request fixes 1 alert when merging 2f3faf9 into 426a8f9 - view on LGTM.com fixed alerts:
|
|
@thedrow low priority ping on this. It should be good for you to land if you're comfortable with it appearing in the RC1. Otherwise we can merge after 5.1 is pushed out. |
|
merging this as the actual fix is not that big and it's a bug fix. so it should be qualified for 5.1.0rc |
Good call. |
…elery#6746) * fix: Use chord kwarg over request in group.apply * fix: Propagate errors from failed chain tasks Fixes celery#6220 Co-authored-by: Maximilian Friedersdorff <[email protected]> Co-authored-by: maybe-sybr <[email protected]> * fix: Ensure all subtasks of a group get errbacks Giving a linked task callback to the 0th task in a group is fine, but for errbacks it's not an appropriate choice since any task in the group could fail. This ensures that if any task other than the 0th one fails, the errback will be called. This opens the possibility for an errback to be called more than once when linked to a group, but generally we expect that they should be design to be idempotent so no warning is issued for the changed behaviour. * test: Add tests for child error propagation * test: Add regression tests for group errback dupes These tests simply encode the currently expected behaviour where errbacks linked to a group will be called once for each failed task, as well as the consequences for chords which turn their header into a group if it is not one already. * doc: Add extra docs for canvas call/errback usage Co-authored-by: Crawford, Jordan <[email protected]> Co-authored-by: Maximilian Friedersdorff <[email protected]>
Description
Fix propagation of errors and errback calling from chord and group children. This changeset
supersedes #6226 and rolls in some of the test cases presented by @maxfenv in comments
on that PR.
Fixes #6220 and a few other issues discovered along the way.