Skip to content

Group tasks' results order getting messed up when using redis #3781

@nitheeshas

Description

@nitheeshas

I upgraded to celery v4.0.2 from an old v3.x version and now I'm facing a weird issue with groups.
So here is my tasks file to reproduce the issue:

from celery import group, chord
from worker import app


@app.task(name='task')
def task(i):
    return i


@app.task(name='dummy')
def dummy(result):
    print result


@app.task(name='mainTask')
def mainTask():
    groupTask = group([task.s(i) for i in range(0,10)])
    job = chord(groupTask, dummy.s())()
    return job

The expected output of the variable result is:

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

and this is indeed what I'm getting when using amqp as result backend. But when I use redis, the output gets messed up. Basically, the redis backend is serving the results in the order the group tasks get finished, and not in the order its assigned. A sample would be:

[0, 1, 2, 3, 4, 8, 6, 9, 7, 5]

Is there something I'm missing? I've posted the same thing over in stackoverflow as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions