1587 Commits

Author SHA1 Message Date
Jun
21d6287e15 Fix fdopen RuntimeWarning in 3.8 (#2146) 2019-10-30 09:16:07 +01:00
Hasan Ramezani
e7890d8d1b
Fix lint errors (#2123) 2019-10-27 11:57:16 +01:00
Jeff Brooks
ad6ed3f4c8 Implement check and exception for str type on value in Response process_headers method. 2019-10-15 09:03:44 -05:00
Jeff Brooks
54c820feb3 Ensure header value is string before conducting regex search on it. 2019-10-10 10:41:22 -05:00
Benoit Chesneau
e6a88dbfcd bump to 20.0.0 2019-09-27 01:47:03 +02:00
Benoit Chesneau
ce03c192f4 fix formatting 2019-09-27 01:45:03 +02:00
장준영
d765f0d123 Group exceptions with same body together in Arbiter.run() (#2081) 2019-08-20 03:34:18 +03:00
Randall Leeds
40802904eb Avoid unnecessary chown of temporary files
When Gunicorn is configured to change the effective user or group of the
worker processes, it changes the owner and group fo the the temporary
files used for interprocess communication.

With this change, Gunicorn does not change the owner or group of the
files if the worker processes will run as the current effective user and
gorup. This change avoids calling chown when it is not necessary, which
may allow Gunicorn to be used in environments that restrict use of the
chown syscall.

Relates to #2059.
2019-08-19 11:22:58 -07:00
Martin Bašti
7e640f804c Logging: Handle auth type case insensitively
According RFC-7617 (inherited from RFC-2978) schema and parameter names are handled
case insensitively:
```
Note that both scheme and parameter names are matched case-
insensitively.
```

Signed-off-by: Martin Bašti <mbasti@redhat.com>
2019-07-17 18:56:18 +03:00
Marwan Rabbâa
dc7b5d5c48 Fix compatility with tornado 6 (#2001) 2019-06-04 14:17:01 -07:00
c-bata
6df58a99b5 Remove util.import_module 2019-05-28 16:07:31 +03:00
Masashi SHIBATA
a13a2096ed Use SourceFileLoader instead instead of execfile_ (#2046) 2019-05-26 22:09:52 +03:00
Masashi SHIBATA
3701ad9f26 Use importlib instead of __import__ and eval (#2043) 2019-05-22 22:07:02 +03:00
c-bata
85ec74fc10 Fix typo: connnection to connection 2019-05-20 22:24:45 +09:00
c-bata
aa8b258f93 Fix typo: treatement to treatment 2019-05-20 12:56:44 +03:00
c-bata
d4ff4b419c Fix typo: peform to perform 2019-05-20 12:56:18 +03:00
c-bata
dc639e0d0e Fix typo: hanle 2019-05-20 12:54:59 +03:00
Sebastien Williams-Wynn
678b326dc0 Fix typo in --worker-class documentation (#2030) 2019-05-09 21:13:31 +03:00
Randall Leeds
a542a07773 Fix eventlet patching and bump required version
Fix eventlet patching by performing the patching before the
`init_process` method, which does not return, is called.

This fix depends on bumping the required version to 0.24.1, which
contains a fix for the monotonic clock. See the relevant commit:
eventlet/eventlet@82f1877

This commit reverts 120f503f68929ef98d721a406745a1dbbb9d83fe

Fix #1847
Fix #1884
2019-05-08 19:23:13 -07:00
Benoit Chesneau
cf8ac37ce4
Merge pull request #1969 from benoitc/wsgi_input_terminated
handle `wsgi.input_terminated` extension
2019-04-29 13:58:05 +02:00
dblack
96dde54af1 optional datadog tags for statsd metrics 2019-04-27 18:49:47 -07:00
Brett Randall
879651bb6f Header values are encoded using latin-1, not ascii.
This commit reverts one aspect changed by 5f4ebd2eb2b08783a5fbefe79d09fcb3fc1fbc73 (#1151);
header-values are again encoded as latin-1 and not ascii. Test is restored but uses
a latin-1-mappable test-character, not a general utf8 character.

Fixed #1778.

Signed-off-by: Brett Randall <javabrett@gmail.com>
2019-04-18 04:23:19 +03:00
Randall Leeds
cc8e67ea83 Fix new pylint errors 2019-03-16 16:11:23 -07:00
Hasan Ramezani
2b07f2be28 Rewrite parse_address util and add one test 2019-03-16 15:07:53 -07:00
Marat
a8963ef1a5 Remove redundant super() arguments 2019-03-16 15:00:07 -07:00
Andrew Widdersheim
a2a8bc1ae6 Move ThreadPoolExecutor() creation into own method
Move ThreadPoolExecutor() creation into it's own method so it is easier
to override when subclassing.
2019-02-21 09:28:47 -08:00
Andrew Widdersheim
5680320e5c Simplify futures import
Commits e974f305 and 78208c8c removed support for Python 2 and Python
<3.4 respectively so the conditional logic for importing
`concurrent.futures` is no longer necessary as it has been part of the
standard library since Python 3.2.
2019-02-20 05:57:49 +03:00
Benoit Chesneau
7ed20f6833 corretly set max_requests
fix #1978
2019-02-07 17:04:15 +01:00
Benoit Chesneau
194f47f92b
Merge pull request #1957 from benoitc/simplify-paste-integrations
Simplify Paste Deployment integration
2019-02-06 09:17:28 +01:00
Randall Leeds
9f87c88819 Bump minimum Eventlet and Gevent versions (#1962)
Update the Eventlet and Gevent worker classes to check for versions of
Eventlet and Gevent that are stable under Python 3 and remove outdated
compatibility code.
2019-01-25 08:24:14 +01:00
Benoit Chesneau
97a45805f8
remove gaiohttp worker (#1971)
* remove gaiohttp worker

worker is deprecated and won't work on latest version.
2019-01-24 23:05:28 +01:00
Daniel Pope
2ea5fbdc86 Use Python's default SSL cipher list by default (#1970) 2019-01-24 22:41:04 +01:00
Benoit Chesneau
e5141a1c5a handle wsgi.input_terminated extension
fix #1653
2019-01-24 15:47:15 +01:00
Randall Leeds
61e136b922 Simplify Paste Deployment integration
Remove the `gunicorn_paster` command. With the `--paste` option to the
`gunicorn` command, Gunicorn will no longer read the server section of
the configuration. Instead, server configuration must be done with
Gunicorn configuration files, command line switches, and environment
variables.

The use of Gunicorn as a Paste Deployment server factory is no longer
deprecated. It allows specifying `host` and `port`, as well as `bind`,
but is otherwise more strict with options than in the past. Rather than
ignoring unknown options it will raise an error.

Close #1189
2019-01-22 03:58:03 -08:00
fangfei
6da84c614d Fix root logging
root and logger are same level. https://docs.python.org/2/library/logging.config.html#dictionary-schema-details
2019-01-21 22:51:55 -08:00
Brett Randall
c85bfba8b2 Fixed typo in ssl_version doc, TLSv2 -> TLSv1_2 (TLS 1.2). (#1959)
* Fixed typo in ssl_version doc, TLSv2 -> TLSv1_2 (TLS 1.2).

Signed-off-by: Brett Randall <javabrett@gmail.com>

* revert chdir change
2019-01-22 00:03:38 +01:00
Дамјан Георгиевски
9184ae8898 add systemd sd_notify support (#1897)
* add systemd sd_notify support

roughly based on sd_notify() from systemd and https://github.com/bb4242/sdnotify

only implements `READY=1` and `STATUS=Gunicorn arbiter booted` of the
protocol in the arbiter. in the future, reloads can be notified, and
possibly also other statuses.

see https://www.freedesktop.org/software/systemd/man/sd_notify.html for
more info

sd_notify() is a noop when not run in a systemd service (i.e
NOTIFY_SOCKET environment variable is not set)
2019-01-11 04:41:09 +01:00
Pengpeng Zuo
ad1afe7b79 Fix typo in gthread.py 2018-12-23 12:11:36 +03:00
Niklas B
33025cf610 tornado 5 support (#1918)
tornado 5 support by keeping track of the periodic callbacks
2018-12-09 10:23:56 +01:00
Florian Apolloner
ee7af1247b Added support to --bind to open file descriptors (#1809)
Fixes #1107
2018-11-16 20:21:13 +03:00
Berker Peksag
c66957bbe9 Add support for named constants in the --ssl-version flag
Fixes #1114

Co-Authored-By: Brett Randall <javabrett@gmail.com>
Signed-off-by: Brett Randall <javabrett@gmail.com>
2018-10-31 14:43:40 +03:00
Ron DuPlain
e5c11e8f8a Clarify log format usage of header & environment (#1907) 2018-10-28 23:38:51 +03:00
Konstantin vz'One Enchant
927fb2ba02 Prevent removal unix socket for reuse_port (#1887)
If you have two (or more) instances of gunicorn that use `reuse-port`
and bind to single unix socket all work until one of gunicorn will
stopped. Because the first stopped removes unix socket file and other
instances can't longer process requests.
2018-10-02 13:25:35 +02:00
Ryan Lopopolo
eae3ef05f3 Fix ResourceWarning when reading a Python config module (#1889)
The raw open call in execfile_() did not close the file handle.
2018-10-02 09:53:26 +03:00
Konstantin Enchant
df8290d153
Revert "Prevent removal unix socket for reuse_port"
This reverts commit af7f158d224c9925e3315ee216c07adc09c64b61.
2018-10-01 14:29:25 +03:00
Konstantin vz'One Enchant
af7f158d22
Prevent removal unix socket for reuse_port
If you have two (or more) instances of gunicorn that use `reuse-port` and bind to single unix socket all work until one of gunicorn will stopped. Because the first stopped removes unix socket file and other instances can't longer process requests.
2018-10-01 12:52:03 +03:00
刘金俭
59bf81cb58 Remove unnecessary call to dict keys method 2018-09-24 10:31:28 -07:00
Randall Leeds
e179dc2575 Support str and bytes for UNIX socket addresses (#1882)
Some systems report UNIX socket addresses as bytes while others will
report it as a unicode string type. This patch improves socket type
detection code to support both.

Fix #1861
2018-09-24 08:57:53 +02:00
Pritam Baral
30554fdb4f InotifyReloader: Handle module.__file__ is None
0f527a01f4 added a fix for the case when some modules have the `__file__` attr set to `None`, for the polling reloader. Unfortunately, it missed making the same fix for the inotify reloader.

This change copies that fix into InotifyReloader
2018-09-17 11:24:17 -07:00
Benoit Chesneau
91974f0f44 Merge branch 'pr-1724' 2018-09-04 12:19:30 +02:00