Skip to content

Windows 7: celery.chain hangs [Python 3] #2473

Description

@waynenilsen

Platform dependent results found:

# test_celery.py
import celery

app = celery.Celery(
    'test_celery'
    ,broker =  'redis://a.redis.server:6379/9'
)

app.conf.update(
    CELERY_RESULT_BACKEND = 'redis://a.redis.server:6379/9'
)

@app.task()
def add(x, y):
    return x + y

if __name__ == '__main__':
    result = add.delay(1,1).get()
    print(result)
    # result is 2, works on both 

    result = celery.chain([
        add.si(1,1)
    ])().get()
    print(result)
    # result is 2, works on both 

    result = celery.group([
        add.si(1,1)
        ,add.si(2,2)
    ])().get()
    print(result)
    # result is [2, 4], works on both 

    result = celery.chain([
        add.si(1,1)
        ,add.si(2,2)
    ])().get()
    print(result)
    # result is hang on windows and 4 on linux

I did some debugging, looks like something isn't going quite right around line 280 of celery/app/trace.py but it is likely that I have no idea what I'm talking about. This file works on ubuntu pointing to the same redis server. Tested both using Python 3.4 Celery 3.1.17

To reproduce, in each environment:

  • run celery -A test_celery worker --loglevel=INFO
  • run python3 test_celery.py

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions