Skip to content
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

Joining to chains loses link_error of least chain #4232

Closed
atn18 opened this issue Aug 29, 2017 · 0 comments · Fixed by #4240
Closed

Joining to chains loses link_error of least chain #4232

atn18 opened this issue Aug 29, 2017 · 0 comments · Fixed by #4240

Comments

@atn18
Copy link
Contributor

atn18 commented Aug 29, 2017

celery/celery/canvas.py

Lines 408 to 414 in cbbf481

elif isinstance(other, _chain):
# chain | chain -> chain
sig = self.clone()
if isinstance(sig.tasks, tuple):
sig.tasks = list(sig.tasks)
sig.tasks.extend(other.tasks)
return sig

Should be something like

    link_error_sigs = other._with_list_option('link_error')
    sig.tasks.extend(
        reduce(
            lambda t, s: t.on_error(s), link_error_sigs, t.clone())
        for t in other.tasks)
thedrow pushed a commit that referenced this issue Sep 26, 2017
* Assign link_error sugnatures to each task

issue #4232
Chain could have link_error signatures for error processing.
Joining chains copies tasks from other chain to original one.
Thus copying loses other chain's link_error signatures.
Assigning chain's link_error signatures to each task could have
the same effect.
Each task from other chain are cloned to leave original ones as is.

* Clone full chain's state

In appending task to chain clone full chain's state and
append task to chain's tasks.

* Fix chaining to chains

* Add test for keeping link_error on chaining

* Fix chaining group to chain

* Fix indentation according to PEP8

* Fix blank lines

* Avoid reduce function usage

* Move common code to separate method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant