{ "info": { "author": "Mikhail Antonov", "author_email": "atin65536@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development" ], "description": "# celery-graceful-stop\n\n[Celery](http://celeryproject.org) plugin provides ability of graceful worker stopping.\n\n# Problem\nProduction deployment of long running tasks require worker to be stopped gracefully. Unfortunately celery got different behaviour:\n\n1. Receiving `SIGTERM` signal by `celery` results starting **Warm shutdown** procedure. Due this procedure, `inspect` and `control` commands become unavailable.\n2. More than that, all tasks are terminated forcely by the second `SIGTERM` with the **Cold shutdown** procedure.\n\nThis module provides more consistent approach to this problem, it\n\n1. overrides `SIGTERM` receiver to prevent default **Warm shutdown** and **Cold shutdown** worker behaviour,\n2. forces `inspect` and `control` commands to be working even after `SIGTERM` signal received.\n\n# Installation & Setup\n\n```\npip install git+https://github.com/MnogoByte/celery-graceful-stop.git\n```\n\nAppend your `proj/celery.py` file containg `app` instance with the following lines.\n\n```python\nimport celery_graceful_stop\ncelery_graceful_stop.register(app)\n```\n\n# Settings \n\n- `CELERY_GRACEFUL_STOP` (boolean). Controls graceful stop function. (`True` by default)\n\n# Using with systemd\n\n1. Define 1 service per each worker you got (systemd require only one master `pid` for restart).\n2. Provide `/etc/conf.d/celery_` configuration file for each worker.\n3. Add [celery@.service](systemd/celery@.service) file into your system.\n4. Register your service with `systemctl enable celery@`.\n\n# Limitations\n\n- 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.\n- This module has been tested only with celery 3.1 with pool=prefork.\n\n# Author\n\n[Antonov Mikhail](https://github.com/atin65536)\n\n# License\n\nBSD - 3", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MnogoByte/celery-graceful-stop", "keywords": "celery,stop,graceful,reload", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "celery-graceful-stop", "package_url": "https://pypi.org/project/celery-graceful-stop/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/celery-graceful-stop/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/MnogoByte/celery-graceful-stop" }, "release_url": "https://pypi.org/project/celery-graceful-stop/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Celery plugin thats adds ability to graceful stop worker", "version": "0.0.1" }, "last_serial": 2033685, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4c5616ded4cac336c2d2ed37442c7a8f", "sha256": "ba98c9cc835101064d8fd438f29848cd0d33ec9eefd4c117ff3fe7a0864647de" }, "downloads": -1, "filename": "celery-graceful-stop-0.0.1.tar.gz", "has_sig": false, "md5_digest": "4c5616ded4cac336c2d2ed37442c7a8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4802, "upload_time": "2016-03-29T11:11:34", "url": "https://files.pythonhosted.org/packages/99/e1/803b5cb691f949c721163c97c5f8ef2751e67772321a93ff04904facfd5e/celery-graceful-stop-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4c5616ded4cac336c2d2ed37442c7a8f", "sha256": "ba98c9cc835101064d8fd438f29848cd0d33ec9eefd4c117ff3fe7a0864647de" }, "downloads": -1, "filename": "celery-graceful-stop-0.0.1.tar.gz", "has_sig": false, "md5_digest": "4c5616ded4cac336c2d2ed37442c7a8f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4802, "upload_time": "2016-03-29T11:11:34", "url": "https://files.pythonhosted.org/packages/99/e1/803b5cb691f949c721163c97c5f8ef2751e67772321a93ff04904facfd5e/celery-graceful-stop-0.0.1.tar.gz" } ] }