Skip to content

GroupResult.as_tuple forget serialize group parent #4106

Closed

Description

@tbazadaykin
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>
>>>

Activity

  1. auvipy commented on Jul 13, 2017

    @auvipy
    Member

    does this produce same against master branch

  2. tbazadaykin commented on Jul 24, 2017

    @tbazadaykin
    Author

    does this produce same against master branch

    yes, it is

  3. pachewise commented on Aug 16, 2017

    @pachewise
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions