'Celery inspect function is hanging, how to troubleshoot?
As I follow the celery documentation
> from celeryapp import app
> i = app.control.inspect()
> i.active()
The inspection seems to hang. Has anyone seen this before? And can anyone shed some light on why this might happen?
It happens when I call reserved, and even for ping. I am guessing if even a ping hangs- a connection isn't being made.
I am using AMQP as a broker- to what extent is the broker involved? How can I troubleshoot?
I am guessing this is probably a pretty simple thing to solve- but atm I am lost, and would highly appreciate a clear walkthrough.
Many thanks!
Solution 1:[1]
A celery control command is sent in the celery.pidbox exchange that all celery workers are listening to by default and responded to on short-lived reply queues.
So "to what extent is the broker involved?"
It is the medium the question and answer go through.
"How can I troubleshoot?"
This is the heart of the question and rather involved, any problem in this whole pipeline will cause issues with celery control commands, ping included. Which is why I don't recommend depending on it in a production system to known active tasks or other details.
In no particular order I would check:
- Connection to the broker from control node (wherever you are running
app.control.inspect()), - That queues ending in
.pidboxare healthy on the broker. - That at least one worker is actually responsive.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | chicocvenancio |
