Rainbow Saddle
rainbow-saddle is a wrapper around Gunicorn to simplify code reloading without dropping requests.
Installation
Install from pypi:
$ sudo pip install rainbow-saddle
Or from source:
$ sudo ./setup.py install
Why?
Sometimes doing a kill -HUP <gunicorn PID> is not sufficient to reload your code. For example it doesn’t work well if you host your code behind a symlink, or if a .pth in your installation is updated to point to a different directory.
The correct way to reload code in such situations is a bit complicated:
# Reexec a new master with new workers /bin/kill -s USR2 `cat "$PID"` # Graceful stop old workers /bin/kill -s WINCH `cat "$PIDOLD"` # Graceful stop old master /bin/kill -s QUIT `cat "$PIDOLD"`
It also has the downside of changing the “master” process PID, which confuses tools such as supervisord.
rainbow-saddle handles all of this for you, and never changes its PID. Reloading code becomes as simple as sending a SIGHUP again:
$ rainbow-saddle --pid /tmp/mysite.pid gunicorn_paster development.ini --log-level debug $ kill -HUP `cat /tmp/mysite.pid`
News
0.4.0
Support new binary upgrade method used by Gunicorn, since version 19.6.0. Drops support for all previous versions of Gunicorn. See commit benoitc/gunicorn@418f140 for more info, thanks to Jacob Magnusson.
0.3.1
Minor Python3 compatibility fix, thanks to Justin Locsei.
0.3.0
Thanks to Rafael Floriano da Silva for the following:
add –gunicorn-pidfile
fix race condition for slow starting apps
update psutil
Metadata
Release files for rainbow-saddle 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rainbow-saddle-0.4.0.tar.gz | 5.2 kB | Without provenance | Details |
Release files / rainbow-saddle-0.4.0.tar.gz
| Download URL | rainbow-saddle-0.4.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
97a481c16151c5bf9d08530117c5b2a345f0935f669862d268f5ffabfe060566
|
|
BLAKE2b-256 checksum How to use checksums |
59a025744c1b1fe7631b43bd69a9bbf4f195ba08bb3cedb3ab41cbd3ad1a0b17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for rainbow-saddle 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.