2282 Commits

Author SHA1 Message Date
benoitc
8a6748ee65 fix unix socket locking
This change add proper file locking to gunicorn. By default "gunicorn.lock" is created in the temporary directory when a unix socket is bound.  In case someone want to fix the lock file path or use multiple gunicorn instance the "--lock-file" setting can be used to set the path of this file.

fix #1259
2016-05-14 22:03:40 +02:00
benoitc
fbe865f37a fix issues links 2016-05-13 21:01:43 +02:00
Randall Leeds
aadbddb622 Merge pull request #1260 from daavve/master
added some more detail for setting up gunicorn on systemd
2016-05-13 09:49:38 -07:00
Berker Peksag
26c67f8d3f Merge pull request #1262 from vishesh92/patch-1
Fix note for design.rst
2016-05-13 17:05:38 +03:00
vishesh92
58987b27fb Fix note for design.rst 2016-05-13 19:25:00 +05:30
David McInnis
d27bf96690 fixed typo where we start the wrong service 2016-05-12 11:52:27 -07:00
benoitc
8e8611a741 add debuginfo when retrying socket creation 2016-05-12 09:34:05 +02:00
David McInnis
35f9e3e77c added some more detail for setting up gunicorn on systemd 2016-05-12 00:33:39 -07:00
Benoit Chesneau
081f8eec08 Merge pull request #1254 from jgehrcke/jp/exclog
Do not swallow exception raised during worker exit
2016-05-11 21:58:06 +02:00
benoitc
7c2584e073 19.5 is tagged 2016-05-11 21:33:50 +02:00
Jan-Philip Gehrcke
66a07032ba docs: clarify that worker_exit hook runs *in* the worker 2016-05-11 13:36:31 +02:00
Jan-Philip Gehrcke
f4842a5ab8 Log exception occurring during worker exit 2016-05-11 13:36:28 +02:00
benoitc
7d61a60ebd add changelog
releae often shoudl be our mantra. We have too much fixes in that release that
were waiting since a while. Let's start a month release (ore more) from now.
2016-05-10 21:43:06 +02:00
Benoit Chesneau
58f190d346 Merge pull request #1257 from benoitc/fix/1256
unblock the wait loop under python 3.5
2016-05-10 21:14:47 +02:00
benoitc
b0c0333248 unblock the wait loop under python 3.5
in python 3.5 the select is blocking when waiting for it which prevent quick
exit on SIGTERM.

The problem is described:
https://www.python.org/dev/peps/pep-0475/#backward-compatibility

This change fix it by listening for signal event on the worker pipe. Once an
event is triggered it will forcefully wake up the select and return.

fix #1256
2016-05-10 09:08:17 +02:00
Phil Jones
9d158bec94 Add access_log_format to config example (#1251)
The example given is the current default log format.
2016-05-03 14:15:36 +03:00
benoitc
ded610ede9 add a note about the requirements of the threads workers under python 2.x
fix #1200
2016-05-02 15:44:38 +02:00
benoitc
6f9ae5ee2f put a note that error logs are only errors from Gunicorn.
fix #1124
2016-05-02 15:41:16 +02:00
benoitc
65db610afe print error logs on stderr and access logs on stdout
fix #1184
2016-05-02 15:26:15 +02:00
benoitc
5fa32a6dbc document LOGGING overriding
fix #1051
2016-05-02 15:18:07 +02:00
benoitc
e005c9d93a reverse change in example_config.py 2016-05-02 15:05:15 +02:00
benoitc
66546d66df fix #1246 2016-05-02 15:04:30 +02:00
Benoit Chesneau
89674d6b35 Merge pull request #1248 from gescheit/master
do post_worker_init after load_wsgi
2016-04-29 17:09:45 +02:00
Aleksandr Balezin
95c71cbbfb do post_worker_init after load_wsgi 2016-04-29 17:23:32 +03:00
Eugene Obukhov
a04b5f0975 Add tests for reader classes (#1241)
* Fix FakeSocket.recv method

* Add tests for Unreader and its subclasses

* Add tests for EOFReader and LengthReader
2016-04-15 00:49:00 +03:00
Berker Peksag
07428ddbfe Merge branch 'delete-old-django-app' 2016-04-15 00:40:39 +03:00
felipe
06c1429af7 Add an example to demonstrate using a Django setting file as Gunicorn config 2016-04-15 00:35:31 +03:00
Berker Peksag
36d2c4d809 Delete old Django 1.1-1.3 example 2016-04-15 00:19:38 +03:00
John Ryding
6a3bd70d2b Add gthread and gaiohttp to settings docs 2016-03-26 01:39:29 +02:00
Randall Leeds
bab8ce016d Merge pull request #1218 from benoitc/gevent-remove-inner-exception-loop
[gevent] remove obsolete exception clauses in run
2016-03-25 13:22:33 -07:00
Randall Leeds
706eb98f33 Merge pull request #1222 from benoitc/fix/922-eventlet-graceful-close
[eventlet] close sockets at graceful shutdown
2016-03-25 13:19:21 -07:00
Randall Leeds
fd8b8e49c6 Merge pull request #1230 from benoitc/fix/922-thread-graceful-close
[thread] close sockets at graceful shutdown
2016-03-25 13:18:47 -07:00
Randall Leeds
3b0529d5a9 Merge pull request #1235 from MarSoft/fix-traceback
Fixed traceback formatting for syntax errors
2016-03-24 14:15:18 -07:00
Semyon Maryasin
03a944d668 Fixed traceback formatting 2016-03-24 00:37:12 +03:00
Randall Leeds
f104a0ef20 Merge pull request #1217 from benoitc/eventlet-async-quit
[eventlet] handle QUIT in a new coroutine
2016-03-22 10:37:13 -07:00
Benoit Chesneau
7be2b8d2ba Merge pull request #1231 from benoitc/fix/gh1177
prevent crash when reporting an error
2016-03-22 13:07:30 +01:00
benoitc
1ccebab763 prevent crash when reporting an error
Try to not crash when reporting an error. This changes makes sure we can log the uri and also handle SSL errors.

fix #1177
2016-03-22 11:32:01 +01:00
Randall Leeds
f2418a95e0 [thread] close sockets at graceful shutdown
The run loop has to change slightly to support graceful shutdown.
There is no way to interrupt a call to `futures.wait` so instead
the pattern, used by the async workers, is to sleep for only one
second at the most. The poll is extended to a one second timeout
to match.

Since threads are preemptively scheduled, it's possible that the
listener is closed when the request is actually handled. For this
reason it is necessary to slightly refactor the TConn class to store
the listening socket name. The name is checked once at the start of
the worker run loop.

Ref #922
2016-03-20 17:34:55 -07:00
Berker Peksag
31fd844333 Fix test_http on Python 2 2016-03-20 08:16:05 +02:00
Berker Peksag
b17f1bc305 Fix typo in test name 2016-03-20 07:52:59 +02:00
Berker Peksag
33924a8649 Use more pytest.raises() in test_http.py
Signed-off-by: Berker Peksag <berker.peksag@gmail.com>
2016-03-20 07:52:13 +02:00
Randall Leeds
5b32dde3ef Merge pull request #1228 from lyft/circular-ref-async-fd-leak-fix
Fix delayed socket close caused by circular ref from assigning traceback to local var
2016-03-19 18:18:28 -07:00
Paul Fisher
20d3a2d0c9 clean up sys.exc_info calls to drop circular refs 2016-03-19 17:27:58 -07:00
benoitc
6b34cdba71 bump to 19.5.0 2016-03-19 19:23:34 +01:00
benoitc
1e10a02e73 check if the header contains control characters
fix #1227
2016-03-19 19:16:59 +01:00
Berker Peksag
52088be726 Merge pull request #1226 from zx-zheng/add_psf_license
Add PSF License Agreement to selectors.py
2016-03-16 10:37:01 +02:00
Zheng Zhongxiang
9f3798abe5 Add PSF License Agreement of selectors.py to NOTICE 2016-03-16 16:47:43 +09:00
Randall Leeds
b6afc28528 Merge pull request #1221 from benoitc/fix/922-arbiter-close-on-shutdown
[arbiter] close sockets on shutdown
2016-03-13 16:59:02 -07:00
Randall Leeds
48d1e74d01 [eventlet] close sockets at graceful shutdown
Ref #922
2016-03-13 16:57:42 -07:00
Randall Leeds
39cecbc8e9 [arbiter] close sockets on shutdown
Close all the listeners when the arbiter shuts down. By doing so,
workers can close the socket at the beginning of a graceful shut
down thereby informing the operating system that the socket can
be cleaned up. With this change, graceful exits with such workers
will refuse new connections while draining, allowing load balancers
to respond more quickly and avoiding leaving connections dangling
in the listen backlog, unaccepted.

Ref #922
2016-03-13 16:47:23 -07:00