1

I'm running a celery worker as a systemd daemon which serves a lot of long-running agents.

When I restart the worker all the agents hang and stop running new tasks waiting for pending ones.

  • Restarting agents is not an acceptable solution for me.
  • I'd also avoid using task timeouts

Is there a way to restart the worker gracefully to not impact already running agents?

All the agents are python scripts.

Maksym Polshcha
  • 18,030
  • 8
  • 52
  • 77
  • might be a duplicate of https://stackoverflow.com/questions/9764913/how-do-i-restart-celery-workers-gracefully, specifically the answer regarding stopping workers with the `HUP` signal – Jason Jan 26 '18 at 17:02
  • @Jason That's exactly how I do restart the workers. – Maksym Polshcha Jan 26 '18 at 17:03
  • via `ps auxww | grep celeryd | grep -v "grep" | awk '{print $2}' | xargs kill -HUP`? Apparently your desire isn't all that possible to do in celery. – Jason Jan 26 '18 at 17:04
  • @Jason Nope, I use `celery multi restart|stopwait`. Why do you say it's not possible? – Maksym Polshcha Jan 26 '18 at 17:10

0 Answers0