Track the use of systemd socket activation and gunicorn socket inheritance
in the arbiter. Unify the logic of creating gunicorn sockets from each of
these sources to always use the socket name to determine the type rather
than checking the configured addresses. The configured addresses are only
used when there is no inheritance from systemd or a parent arbiter.
Fix#1298
The new version of pip won't support Python 3.2
and we will need to tweak our .travis.yml and
tox.ini in order to run tests on PyPy 3.
However, since we already removed Python 3.2
from Travis, I decided to remove PyPy 3 as well
(it still targets Python 3.2)
Numbers must be separated by dot. This makes life
a little bit harder for attackers who would like to inject specially crafted packets after GET / (e.g. in nginx there are sometimes regular expressions like (?P<action>[^.]).html
* Fix validate_reload by returning the validated value
When '--reload=RELOADER_TYPE' was implemented, `validate_reload()` was
added but in one of the last refactorings, it lost the return statement
at the end of the function. As a result, the '--reload' config value was
totally broken.
This resolves the issue by adding the missing return.
* Fix tests by changing --reload to always require an argument
- '--reload' always requires an argument now
- Added 'auto' as the default value for '--reload'
--reload = Runs the reloader with inotify if available and falls back on
FS polling.
--reload=inotify = Forces the reloader to run with inotify
--reload=poll = Forces the reloader to use FS polling
Currently, '--reload' uses FS polling to find out when files have
changed. For some time, the Linux kernel has had a feature called
inotify that allows applications to monitor for FS events without
polling.
This commit adds a new 'use-inotify' configuration option that will
cause gunicorn to use the new 'InotifyReloader' instead of the default
'Reloader' when 'reload' is enabled.
Using inotify can result in lower CPU consumption by gunicorn especially
when working with virtualized filesystems or environments with a large
number of watched files / directories.
`socket.fromfd` does not close the original file descriptor, so we have to explicitly close it to avoid a leak.
See also:
http://bugs.python.org/issue10099
logging.StreamHandler deault to sys.stderr, so make sure access log are printed to stdout when choosing "-" by forcing the stream.
Note: access logs were printed to stdout by default when using the config file.
fix#1184