2305 Commits

Author SHA1 Message Date
benoitc
0b84f070cf 19.6 has been released. 2016-05-23 17:30:23 +02:00
benoitc
4a04195975 update 19.6.0 changelog 2016-05-21 11:21:53 +02:00
benoitc
37be319f06 add a not in FAQ about the SENDFILE environment var 2016-05-21 11:12:11 +02:00
benoitc
d5a07ce4ff Allow disabling sendfile via an environment variable
add support for the `SENDFILE` environment variable.

fix #1252
2016-05-21 11:06:51 +02:00
Benoit Chesneau
fed56176e5 Merge pull request #1277 from benoitc/fix/1258
gthread: handle removed socket in the select loop
2016-05-21 10:53:20 +02:00
Benoit Chesneau
be70754ede Merge pull request #1276 from benoitc/fix/1271
add --capture-output setting

redirect stdout/stderr to logfile
2016-05-21 10:51:41 +02:00
benoitc
49ebee1386 redtirect stdout/stderr to logfile
Add the new setting `--caapture-output` to capture output from stdout/stderr to the current log file.

fix #1271
2016-05-21 10:50:32 +02:00
benoitc
44d3ac8451 gthread: handle removed socket in the select loop
when it happend there are good chance the socket has been removed because it timeouted on the other end. So ignore it.

fix #1258
2016-05-21 00:13:57 +02:00
Benoit Chesneau
df55657282 Merge pull request #1273 from wipply/pre-exec-environment
Allow to modify environment in pre_exec callback
2016-05-21 00:11:11 +02:00
benoitc
20bde96e14 prepare 19.6.0 release 2016-05-20 16:10:35 +02:00
Benoit Chesneau
c62cf2f500 Merge pull request #1270 from benoitc/improve-arbiter-promotion
remove file locking
2016-05-20 15:56:35 +02:00
Benoit Chesneau
118668c8d6 Merge pull request #1274 from benoitc/revert-1266-improve_lockfile
Revert "lockfile improvements"

committed by error...
2016-05-20 15:56:22 +02:00
Benoit Chesneau
b4dc48dc02 Revert "lockfile improvements" 2016-05-20 15:55:55 +02:00
Benoit Chesneau
3186473e42 Merge pull request #1266 from benoitc/improve_lockfile
lockfile improvements
2016-05-20 15:55:46 +02:00
benoitc
418f140445 remove file locking
This changes improve the binary upgrade behaviour using USR2:

- only one binary upgrade can happen at a time: the old arbiter needs to be
  killed to promote the new arbiter.
- if a new arbiter is already spawned, until one is killed USR2 has no action
- if a new arbiter has been spawned, the unix socket won't be unlinked
- until the old arbiter have been killed the newly created pidfile has the name
  <pidfile>.2 and the name Master.2 .

Note: there is no dialog between both arbiters to handle this features.
Instead they will supervise each others until one is killed. So isolation is
still guaranted.

fix #1267
2016-05-20 15:42:55 +02:00
benoitc
39f62ac66b make sure to remove the signal from the worker pipe
The signal was never removed from the pie which was always waking up the worker
triggering a CPU spike.

fix #1269
2016-05-20 11:40:20 +02:00
Krzysztof Urbaniak
0bd2faa2e7 Allow to modify environment in pre_exec callback 2016-05-17 12:02:02 +02:00
benoitc
062b48d8d2 lockfile improvements
- rename LockFile.lock  to acquire
- rename LockFile.unlock to release
- move the lockfile management in sepate functions inside the arbiter
- remove the "closed" argument from the socket.close method and add a new "destroy" function that will be called whent  the socket can be unlinked (cal release)
- fix tests
2016-05-15 02:30:08 +02:00
Benoit Chesneau
f8e14a53b2 Merge pull request #1261 from benoitc/fix/1129
don't kill ourself on reload
2016-05-15 01:53:26 +02:00
Benoit Chesneau
01f83691e6 Merge pull request #1263 from benoitc/fix/1259
fix unix socket locking
2016-05-14 23:11:17 +02:00
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
d3307cdfa5 add an app example using readline 2016-05-14 17:29:01 +02:00
benoitc
fbe865f37a fix issues links 2016-05-13 21:01:43 +02:00
benoitc
e5d27516cf makes sure to execute the hook and exit cleanly 2016-05-13 20:25:29 +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
benoitc
3cbbc713b1 don't kill ourself on reload
Killing ourself when using the `--reload` option trigger an infinite loop under some monitoring services like the one in pycharm and don't reload the file.

Instead set self.alive as False which will trigger later the worker exit. Note that if we want to force the exit we could also use sys.exit(0) .

fix #1129
2016-05-13 11:09:14 +02:00
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