You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see the following warning appearing in my Celery 3.1.23 log:
[2016-10-07 07:42:29,096: WARNING/Worker-1] /usr/local/lib/python2.7/dist-packages/celery/result.py:45: RuntimeWarning: Never call result.get() within a task!
See http://docs.celeryq.org/en/latest/userguide/tasks.html#task-synchronous-subtasks
In Celery 3.2 this will result in an exception being
raised instead of just being a warning.
warnings.warn(RuntimeWarning(E_WOULDBLOCK))
In my use case there is no possibility of dead lock because the get() is waiting on a result from a task that is executing via a separate queue and on a different worker's thread pool. I worked around the warning by simply implementing a busy wait on the async result ready() status. That work around is acceptable in my use-case. It would not, of course, be acceptable in all use-cases.
My take on this is that deadlock comes with the territory and is a design issue that is the responsibility of the developer. It does not seem appropriate for the underlying tool to raise a warning, or exception, in this case. Particularly when the warning, or exception, is i) incorrect in some cases, and ii) trivial to work around thereby defeating its purpose.
Activity
ask commentedon Oct 10, 2016
You can disable the warning using:
jptrainor commentedon Oct 11, 2016
Thanks, that worked fine.