Skip to content

chord callback receives different input types depending on the length of the chord #4393

Closed

Description

@Bogdanp

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.

Steps to reproduce

from celery import Celery, chord

app = Celery(
    "test",
    broker="amqp://127.0.0.1:5672/",
    backend="cache+memcached://127.0.0.1:11211",
)


@app.task(name="returns-value")
def returns_value():
    return 1


@app.task(name="processes-values")
def processes_values(values, x):
    print(values)


if __name__ == "__main__":
    chord((returns_value.si() for _ in xrange(8)), processes_values.s(42)).delay()
    chord((returns_value.si() for _ in xrange(1)), processes_values.s(42)).delay()

Expected behavior

processes_values should receive a list of values every time.

Actual behavior

processes_values receives a single value when the chord only contains one input task.

[email protected] v4.1.0 (latentcall)

Darwin-16.7.0-x86_64-i386-64bit 2017-11-15 20:13:19

[config]
.> app:         test:0x107f46710
.> transport:   amqp://guest:**@127.0.0.1:5672//
.> results:     memcached://127.0.0.1:11211/
.> concurrency: 8 (prefork)
.> task events: OFF (enable -E to monitor tasks in this worker)

[queues]
.> celery           exchange=celery(direct) key=celery


[2017-11-15 20:13:27,200: WARNING/ForkPoolWorker-1] 1
[2017-11-15 20:13:27,699: WARNING/ForkPoolWorker-6] [1, 1, 1, 1, 1, 1, 1, 1]
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