Skip to content

Chord with single member not correctly passing results to callback #4055

Closed

Description

@e3b0c442

Checklist

  • I have included the output of celery -A proj report in the issue.
    (if you are not able to do this, then at least specify the Celery
    version affected).
  • I have verified that the issue exists against the master branch of Celery.
software -> celery:4.0.2 (latentcall) kombu:4.0.2 py:3.5.3
            billiard:3.5.0.2 redis:2.10.5
platform -> system:Linux arch:64bit, ELF imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:redis results:redis://:**@127.0.0.1/3

Steps to reproduce

  1. Create two chords with the same callback.
  2. In the first chord, call one task in the header. In the second chord, call the same task twice in the header.
  3. View the result passed to the chord callback

Demo code:

@shared_task
def aa():
    return 'a'

@shared_task
def cb(v):
    logger.debug(v)

@shared_task
def tt():
    chord([aa.s()])(cb.s())
    chord([aa.s(),aa.s()])(cb.s())

Expected behavior

The result passed to the callback is list-wrapped for both callbacks
Expected log output from demo code:

[2017-05-26 18:34:08,361: DEBUG/PoolWorker-1] yahoo.contrib.cab_audit.audit.tasks.cb[a6685ec7-017a-4df8-b488-cc1ef8e1bdff]: ['a']
[2017-05-26 18:34:08,382: DEBUG/PoolWorker-5] yahoo.contrib.cab_audit.audit.tasks.cb[b99361d1-f463-4f07-969c-c4d8d193cdfb]: ['a', 'a']

Actual behavior

The result passed to the callback is list-wrapped only when there is more than one task in the header, even if a list is passed in the header.
Actual output from demo code:

[2017-05-26 18:34:08,361: DEBUG/PoolWorker-1] yahoo.contrib.cab_audit.audit.tasks.cb[a6685ec7-017a-4df8-b488-cc1ef8e1bdff]: a
[2017-05-26 18:34:08,382: DEBUG/PoolWorker-5] yahoo.contrib.cab_audit.audit.tasks.cb[b99361d1-f463-4f07-969c-c4d8d193cdfb]: ['a', 'a']

Activity

  1. changed the title [-]Chord with single member not correctly passing [/-] [+]Chord with single member not correctly passing results to callback[/+] on May 26, 2017
  2. e3b0c442 commented on May 26, 2017

    @e3b0c442
    Author

    It looks like this was caused by the fix for #3323 commited in 867a3aa

  3. vnavkal commented on May 30, 2017

    @vnavkal
    Contributor

    +1, I also observe this bug. Thanks for reporting it!

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