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

Chain tasks cannot get parent update_state on 4.3.0 #5494

Closed
2 of 5 tasks
hu6360567 opened this issue Apr 30, 2019 · 6 comments
Closed
2 of 5 tasks

Chain tasks cannot get parent update_state on 4.3.0 #5494

hu6360567 opened this issue Apr 30, 2019 · 6 comments

Comments

@hu6360567
Copy link

hu6360567 commented Apr 30, 2019

Checklist

  • I have read the relevant section in the
    contribution guide
    on reporting bugs.
  • I have checked the issues list
    for similar or identical bug reports.
  • I have checked the pull requests list
    for existing proposed fixes.
  • I have checked the commit log
    to find out if the bug was already fixed in the master branch.
  • I have included all related issues and possible duplicate issues
    in this issue (If there are none, check this box anyway).

Environment & Settings

Celery version: 4.3.0

celery report Output:
software -> celery:4.3.0 (rhubarb) kombu:4.5.0 py:3.7.3
            billiard:3.6.0.0 redis:3.2.1
platform -> system:Linux arch:64bit
            kernel version:4.15.0-45-generic imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis://localhost/

broker_url: 'redis://localhost:6379//'
result_backend: 'redis://localhost/'

Steps to Reproduce

Minimally Reproducible Test Case

from celery import Celery

app = Celery('tq-test', broker='redis://localhost', backend='redis://localhost')


@app.task(bind=True)
def ttt(self, test_str):
    self.update_state(meta={'message': test_str})

def on_raw_message(body):
    try:
        msg = body['result']['message']
    except:
        msg = body
    print(msg)


if __name__ == '__main__':
    chain = app.signature('ttt', args=tuple("a"))
    chain |= app.signature('ttt', args=tuple("b"), immutable=True)
    print(chain.apply_async().get(on_message=on_raw_message))

Expected Behavior

In Celery 4.2.2, update_state in both tasks are shown, as below.

a
b

Actual Behavior

In Celery 4.3.0, only update_state in the task of the end of the chain is shown, as below.

b
@hu6360567
Copy link
Author

FYI, the celery version of the worker does not affect the behavior.

@auvipy
Copy link
Member

auvipy commented May 1, 2019

sorry?

@hu6360567
Copy link
Author

I run the worker with the celery 4.3.0 and the main function with 4.2.2. I can get the expected behavior.
But if the main function with 4.3.0, it can only get the update state from the end task of the chain.

@auvipy
Copy link
Member

auvipy commented Jul 10, 2019

what is the proposed resolution of you?

@hu6360567
Copy link
Author

hu6360567 commented Jul 18, 2019

what is the proposed resolution of you?

Sorry, I haven't used the new version from then...

@auvipy
Copy link
Member

auvipy commented Oct 30, 2021

i am closing this for now. lots of changes were made in canvas in the mean time. will revisit after celery 5.2 release.

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