Don't leak celery workers on reload #2904
Labels
No labels
backend
critical
defect
duplicate
enhancement
fixed
frontend
general
invalid
major
minor
normal
oxjs
pandora_client
python-ox
task
trivial
wontfix
worksforme
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: 0x2620/pandora#2904
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As discussed on IRC, sending
HUP
to the main PID of each celery worker group causes it to restart itself and its children, without cleaning up its old children.Here's a patch with the simplest possible fix: send it
TERM
. This way it cleans up its children and terminates; and then the init system respawns it.The approach upstream takes is to use
celery multi
: https://github.com/celery/celery/blob/3.1/extra/systemd/celery.serviceBut I couldn't make it work!
celery multi start
would claim to have spawned its workers, but they terminated immediately. Running the command shown bycelery multi show
-- which looked right! -- worked fine. stracingcelery multi start
and its children showed one of the children callingexit(1)
but I didn't have the patience to work out why.Attachment 0001-init-restart-celery-workers-on-reload.patch (2394 bytes) added
In 7554b0c/pandora: