-
-
Notifications
You must be signed in to change notification settings - Fork 888
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
SocketIO makes Celery worker hang #61
Comments
This is probably due to the gevent monkey patching, see #55. I plan to remove monkey patching, the extension does not need it anyway. If you want to check if this does it, remove the first two lines in |
Reading #55 and the linked spyoungtech/grequests#8, it seems this is likely the problem. Yes, commenting out the first two lines, that is
removes the problem. I assume this makes Flask-SocketIO dis-functional (haven't tried yet, will tomorrow). I think this is basically the same problem as #55. Also, sorry for the late reply. |
@JanBenes: monkey patching is currently not needed by Flask-SocketIO, that is a left-over from an old version. Applications that depend on monkey-patching can always monkey-patch from their side. I'll go ahead and push an update. |
Version 0.4.1 released. This version removes the monkey patching. |
This works. Thanks! |
I had an application that uses Celery that was working fine. I wanted to add Flask-SocketIO to implement a Celery unrelated feature. However, this made Celery worker hang.
More specifically, I invoke the celery worker by calling
in a directory which has the package
app
as a subdirectory and that initializescelery_app
in its__init__.py
. This would normally show me some info and eventually sayHowever, by adding
to the top of the
app/__init__.py
file, these two last lines would never show and Celery couldn't be killed by pressing Ctrl-C once (which would make it wait for tasks) or twice (which would make it quit immediately). The Celery Worker will hang. Literally, commenting out this oneimport
makes all the difference.I think this is relatively unexpected. Is there a way around? Is that a problem with Flask-SocketIO?
For completeness, the rest of
app\__init__.py
looks like this:I am relatively new to Python/Flask/Celery/SocketIO, so maybe I'm just missing something obvious.
I'm running Python 2.7 on Windows. Also, for what it's worth, it seems socket io also causes a problem with debugging the
__init__
and the main files in pycharm, which I think might be related. Perhaps the immediate server restart is a problem? Later in the run, I can debug views just fine.The text was updated successfully, but these errors were encountered: