Skip to content

Fix length-1 and nested chords (#4393 #4055 #3885 #3597 #3574 #3323) - #4437

Merged
auvipy merged 2 commits into
celery:masterfrom
AlexHill:fix_nested_chords
Dec 12, 2017
Merged

auvipy merged 2 commits into
celery:masterfrom
AlexHill:fix_nested_chords

Conversation

@AlexHill

@AlexHill AlexHill commented Dec 11, 2017 •

Copy link
Copy Markdown
Contributor

In #3323 a change was made to fix an error with nested chords which meant that chords with a header containing a single task were converted to chains.

In my opinion and those of many others (see linked tickets) this is a mis-feature. You define a chord body function expecting a list of results as its first argument, but if the header contains only a single element - as in a dynamically-generated list of header tasks - your callback function will fail.

This PR reverts that change to make chord behaviour more consistent.

It also fixes a problem with deeply-nested chords. As a nested chord is recursively evaluated, the chord option passed down always refers to the top-level chord, meaning the outermost chord ends up being resolved with the result of the innermost signature and chords in between are not executed properly.

I've only got integration tests for this currently - they were easier to write, I'll look at how best to unit test this stuff as soon as I have time.

Thanks!

Other tickets related to this issue: #4393 #4055 #3885 #3597 #3574 #3323

@AlexHill

Copy link
Copy Markdown
Contributor Author

I missed #4301 - this fix seems to be equivalent. @zpl @bruno-rino I'd be interested to know if this fixes your problems.

@thedrow

thedrow commented Dec 11, 2017

Copy link
Copy Markdown
Contributor

@AlexHill If you'd like, I can add you as a maintainer. Your contributions are valuable and welcome :)

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase.

@AlexHill

Copy link
Copy Markdown
Contributor Author

@thedrow sure, thanks!

@AlexHill

Copy link
Copy Markdown
Contributor Author

This is rebased, tests are failing because of unrelated issues with bandit.

@auvipy

auvipy commented Dec 12, 2017

Copy link
Copy Markdown
Member

@AlexHill I have invited you as a collaborator of the project. welcome as a co maintainer and keep the good work up.

@auvipy
auvipy merged commit 10f06ea into celery:master Dec 12, 2017
@AlexHill
AlexHill deleted the fix_nested_chords branch December 12, 2017 07:36
@AlexHill

Copy link
Copy Markdown
Contributor Author

Thanks Asif!

@auvipy auvipy added this to the v4.2 milestone Dec 12, 2017
@thedrow

thedrow commented Dec 12, 2017

Copy link
Copy Markdown
Contributor

Could you please verify and close all the related issues that this PR resolves?

@auvipy

auvipy commented Dec 12, 2017

Copy link
Copy Markdown
Member

I have closed all the related ones, but Alex could cross check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants