New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Chains broken with Celery 3.1.16 and Redis broker #2344
Comments
I have a similar issue. I use amqp as the broker and redis as the backend. This works fine on OS X, but when I move the worker to Windows 2012 R2, it blows up (traceback below). I added some debug to the celery code, and it shows it is trying to hit localhost amqp, instead of the remote machine. The worker has no problem pulling the task chain from the remote amqp initially, so connectivity is not an issue. If run the worker with --pool=solo command line option, it will work fine. I have seen this (solo pool) as a solution to a number of similar issues (here and on stackoverflow), so something obviously is wrong with multiprocessing (pre-fork) on Windows. Note the debug I added at the top. It shows:
|
How do you configure your app? Pickling an app will only include configuration changes, so the initial configuration must be reconstructed by simply importing the module. |
Thanks, @ask - I moved the config to a module and now it works fine. |
@ask can you elaborate please ? I still have the bug on win7/8 and celery 3.1.19 with this sample : # file celeryTest.py
import json
from flask import Flask, Blueprint, abort, jsonify, request, session
from celery import Celery
app = Flask('celeryTest')
app.config.update(
SECRET_KEY = 'not_a_secret',
REDIS_URL = 'redis://localhost',
CELERY_BROKER_URL='redis://localhost',
CELERY_RESULT_BACKEND='redis://localhost',
)
def make_celery(app):
celery = Celery(app.import_name, broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
TaskBase = celery.Task
class ContextTask(TaskBase):
abstract = True
def __call__(self, *args, **kwargs):
with app.app_context():
return TaskBase.__call__(self, *args, **kwargs)
celery.Task = ContextTask
return celery
celery = make_celery(app)
@celery.task
def add(x, y):
return x + y
@app.route("/")
def hello_world():
res = add.apply_async((1,2), link=add.s(10))
return str(res.get())
if __name__ == "__main__":
app.run(debug=True) Work perfecly on linux and not on windows, in advance, thanks !! |
You're using |
Closing this, as we don't have the resources to support Windows. |
File "[python install]\lib\site-packages\amqp\transport.py", line
95, in init
raise socket.error(last_err)
Yes, it calls a function from amqp even though I set redis as a broker and a backend
-------------- celery@Jack_Dalton v3.1.1 (Cipater)
---- **** -----
--- * *** * -- Windows-8-6.2.9200
-- * - **** ---
0
-- ******* ----
--- ***** ----- [queues]
-------------- .> celery exchange=celery(direct) key=celery
I reverted to Celery 3.1.1 and it works fine.
Is 3.1.16 really stable?
The text was updated successfully, but these errors were encountered: