This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

# celery-graceful-stop

[Celery]( plugin provides ability of graceful worker stopping.

# Problem Production deployment of long running tasks require worker to be stopped gracefully. Unfortunately celery got different behaviour:

  1. Receiving SIGTERM signal by celery results starting Warm shutdown procedure. Due this procedure, inspect and control commands become unavailable.
  2. More than that, all tasks are terminated forcely by the second SIGTERM with the Cold shutdown procedure.

This module provides more consistent approach to this problem, it

  1. overrides SIGTERM receiver to prevent default Warm shutdown and Cold shutdown worker behaviour,
  2. forces inspect and control commands to be working even after SIGTERM signal received.

# Installation & Setup

` pip install git+ `

Append your proj/ file containg app instance with the following lines.

`python import celery_graceful_stop celery_graceful_stop.register(app) `

# Settings

  • CELERY_GRACEFUL_STOP (boolean). Controls graceful stop function. (True by default)

# Using with systemd

  1. Define 1 service per each worker you got (systemd require only one master pid for restart).
  2. Provide /etc/conf.d/celery_<service_name> configuration file for each worker.
  3. Add [celery@.service](systemd/celery@.service) file into your system.
  4. Register your service with systemctl enable celery@<service_name>.

# Limitations

  • This module disables pool_shrink, pool_grow, autoscale, pool_reload, add_consumer, cancel_consumer control commands after receiving SIGTERM signal. Actually, you’ll does not need to call them when the worker is shutting down, because worker will not starts new tasks.
  • This module has been tested only with celery 3.1 with pool=prefork.

# Author

[Antonov Mikhail](

# License

BSD - 3

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
celery-graceful-stop-0.0.1.tar.gz (4.8 kB) Copy SHA256 Checksum SHA256 Source Mar 29, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting