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

GroupResult.as_tuple forget serialize group parent #4106

Closed
tbazadaykin opened this issue Jun 26, 2017 · 3 comments
Closed

GroupResult.as_tuple forget serialize group parent #4106

tbazadaykin opened this issue Jun 26, 2017 · 3 comments

Comments

@tbazadaykin
Copy link

celery -A ct report

software -> celery:4.0.2 (latentcall) kombu:4.0.2 py:2.7.9
            billiard:3.5.0.2 py-amqp:2.1.4
platform -> system:Linux arch:64bit, ELF imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:amqp results:cache+memcached://127.0.0.1:11211/

broker_url: u'amqp://guest:********@localhost:5672//'
result_backend: u'cache+memcached://127.0.0.1:11211/'

Steps to reproduce

# ct.py

# ct.py
from __future__ import absolute_import, unicode_literals
from celery import Celery

app = Celery(
    'ct',
    broker='amqp://guest@localhost//',
    backend='cache+memcached://127.0.0.1:11211/'
)

@app.task
def nothing(*args):
   return args

if __name__ == '__main__':
    app.start()

Start worker

python ct.py worker -l INFO

In python console

>>> from celery import chain, group
>>> from celery.result import result_from_tuple
>>> from ct import nothing
>>> c = nothing.s() | group(nothing.s(), nothing.s())
>>> r = c.delay()
>>> r
<GroupResult: f46d7bcc-3140-40e8-9e21-d2f74eef6f28 [4854af6e-8e4a-48d8-98e9-d5f0eefcce20, 5c8d4ec1-84ff-4845-a9b2-9f07fd9bed19]>
>>> r.parent
<AsyncResult: a359ae60-ed18-4876-a67b-fc8cd83759a2>
>>> t = r.as_tuple()
>>> r2 = result_from_tuple(t)
>>> r2
<GroupResult: f46d7bcc-3140-40e8-9e21-d2f74eef6f28 [4854af6e-8e4a-48d8-98e9-d5f0eefcce20, 5c8d4ec1-84ff-4845-a9b2-9f07fd9bed19]>
>>> r2.parent

>>> r2.parent is None
True

Expected behavior

>>> r2 = result_from_tuple(t)
>>> r2.parent
<AsyncResult: a359ae60-ed18-4876-a67b-fc8cd83759a2>
>>>
@auvipy
Copy link
Member

auvipy commented Jul 13, 2017

does this produce same against master branch

@tbazadaykin
Copy link
Author

does this produce same against master branch

yes, it is

pachewise added a commit to pachewise/celery that referenced this issue Aug 16, 2017
@pachewise
Copy link
Contributor

wondering if GroupResult should have a parent? (seems like it should)...
writing a PR for this one.

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

No branches or pull requests

3 participants