904 Commits

Author SHA1 Message Date
benoitc
e77d47cb97 don't raise an error when we close the socket.
fix #537
2013-06-05 10:44:20 +02:00
Benoit Chesneau
438a0e1c66 Merge pull request #532 from kevingessner/master
eventlet: after reaching max_requests, wait up to the graceful_timeout for currently-running requests to complete.  fixes #511
2013-05-31 14:47:06 -07:00
Andreas Stührk
fa7fd6fed0 Use a WSGI "bytes-as-unicode" string for PATH_INFO under Python 3. 2013-05-27 08:33:58 +02:00
Kevin Gessner
567b4f6574 eventlet: after reaching max_requests, wait up to the graceful_timeout for
currently-running requests to complete.  fixes #511

Requests that do not complete within the graceful timeout are killed.
2013-05-16 11:13:12 -04:00
benoitc
981e4112fe bump to 0.17.4 2013-04-24 23:52:24 +02:00
benoitc
82099deff2 remove stupid change.
fix #519
2013-04-24 23:49:50 +02:00
benoitc
3b6b771a71 aggregate Logging options 2013-04-23 17:14:55 +02:00
benoitc
160db1f521 nginx way to set unix addresses 2013-04-23 16:29:31 +02:00
benoitc
532d1fffaf document the use of PYTHONUNBUFFERED in config 2013-04-23 16:23:46 +02:00
Graham Dumpleton
32e4cf14df Ensure that detaching from controlling terminals, but allow for redirection to files. 2013-04-23 16:23:46 +02:00
benoitc
29aefcc1cf only close 0-2 fds when -R isn't specified
Following some discussion on IRC with @GrahamDumpleton this patch only
close stdios if -R isn't specified. It also let others fds open and
don't try to close them.

This should fix logging around and behave like other daemons. It should
also close #309.
2013-04-23 16:23:46 +02:00
benoitc
cc7f595adc Enable stdio inheritance.
Enable inheritance for stdio file descriptors in daemon mode. It allows
you in daemon mode to redirect the output to a file if needed.

By default in daemon mode gunicorn will close all file handle except if
you pass the "-R" options. In this cases STDIO will be preserved.

fix #309
2013-04-23 16:23:46 +02:00
benoitc
208df4ddd9 let the VM close the sockets on exit
Closing sockets when stopping the arbiter was also closing unix sockets
if any because they aren't attached to a specific process. So remove it
and let the vm close them if needed. This change fix the reload of the
binary.

fix #476
2013-04-23 08:38:03 +02:00
benoitc
8eda51267c make sure to not override an existing file 2013-04-23 08:23:06 +02:00
benoitc
2e2432c91b Revert "add GUNICORN_INHERIT_FDS environment variable support"
This reverts commit c9fcb25f51db9ae67f9585c93924e5af8b8bb8b8.
2013-04-22 19:05:31 +02:00
benoitc
612f4125dd make sure we exit immediately if we fail to load the application.
While I'm here describe a more accurate error when it happens.

fix #508
2013-04-22 18:43:20 +02:00
benoitc
3ade8e8d78 make harder for workers to listen at the same time
fix #514
2013-04-22 18:10:18 +02:00
benoitc
4894a1941a make sure we really set the socket to blocking 2013-04-22 18:02:08 +02:00
Alexandre Zani
12ec996d54 Close connection on error after sending started.
When the application starts yielding a body and then raises an error,
we should immediately close the connection to the client to indicate
the error.
2013-04-21 15:01:18 +02:00
Krzysztof Urbaniak
e948195aa9 systemd socket activation 2013-04-21 14:56:06 +02:00
benoitc
ba25de4c1c don't close on exec STDOUT/STDERR 2013-04-21 12:09:46 +02:00
benoitc
c9fcb25f51 add GUNICORN_INHERIT_FDS environment variable support
You can now pass a list of file descriptors to Gunicorn that won't be
closed when it starts. Allows someone to pass any stream to gunicorn or
set some redirection.
2013-04-21 11:57:38 +02:00
benoitc
5e08c27495 improve STDOUT/STDERR logging redirection.
Instead of faking STDIN/STDERR to a fake object that we close on reopen,
simply redirect them to a file and reopen this one when need.

Should fix most of the issues on #309
2013-04-21 11:31:58 +02:00
benoitc
9acafc25f0 catch ValueError when ipv6 isn't not supported on the platform
fix #479
2013-04-21 07:47:19 +02:00
benoitc
c31e0f9ac7 Exit when the config file isn't found.
fix #469
2013-04-21 07:40:06 +02:00
benoitc
038ae7a86c add dd `python -m gunicorn.app.wsgiapp`` support
fix #493
2013-04-21 07:03:59 +02:00
benoitc
765839b2ad we only care of it if gunicorn was started as a daemon
fix #466
2013-04-21 07:00:03 +02:00
benoitc
b263f21646 bump to 0.17.3 2013-04-18 16:46:41 +02:00
benoitc
1a1c9572ef add fileno method to glogging.LazyWriter
fix #496
2013-04-18 16:20:34 +02:00
jean-philippe serafin
1911facf1a improve logger overide
- add Logger.atoms() that facilitates log format override.
- add Logger.atoms_wrapper_class that permits custom wrapping.

fix #510
2013-04-18 16:06:36 +02:00
benoitc
fcc1f5a698 fix doc link
related to issue #484
2013-04-18 15:07:05 +02:00
Chris Streeter
e908ec3359 Consistently get CWD across apps and arbiter.
The Arbiter is smart about getting the CWD; first it checks the CWD
environment (which doesn't resolve symlinks), then it falls back to the
python os.getcwd() (which does resolve symlinks). However, the Arbiter
is the only place that does this, which will then do the right thing
when we reexec. However, when reloading the Arbiter, it won't pick up
changes if the symlink has changed.

By changing the *app.py entry points to also use the same method for
determining the CWD, we'll insert a symlink path into the first location
in sys.path. Then our reloaded app will correctly pull in any new
changes.
2013-04-03 11:15:53 +02:00
benoitc
78478de364 fix pythonpath option.
fix #501
2013-04-03 11:09:12 +02:00
Kevin Luikens
770005f73d use byte string when writing to pid file - fix #504 2013-03-19 13:44:21 -07:00
Kenneth Reitz
a314f5adb1 Merge pull request #485 from mahmoud/master
Remove ctypes dependency in util
2013-03-18 13:54:51 -07:00
Konstantin Enchant
b6d72504eb Fixed stop all servers (gevent worker). 2013-02-25 14:25:08 +04:00
Konstantin vz'One Enchant
a33211b3f3 Merge pull request #488 from streeter/patch-1
Typo fix (docstring)
2013-02-25 01:29:45 -08:00
Konstantin vz'One Enchant
6f03b38401 Merge pull request #489 from streeter/patch-2
Fix a typo (comment).
2013-02-25 01:28:03 -08:00
Konstantin vz'One Enchant
1c920d64cd Merge pull request #468 from dmedvinsky/minor_stuff
Use `getattr` with default instead of `if hasattr/else`
2013-02-25 01:26:17 -08:00
Chris Streeter
5b7696f032 Fix a typo. 2013-02-19 18:28:54 -08:00
Chris Streeter
25283ea262 Fix a Typo 2013-02-19 18:18:41 -08:00
Mahmoud Hashemi
22dccb3349 remove ctypes dependency for unsigned integer math related to setgid. this should re-enable selinux usage (and usage on other systems without ctypes). 2013-02-12 23:01:56 -08:00
Mahmoud Hashemi
318b365b8a fixed unreachable code surrounding 'unix://' addresses. 2013-02-12 22:58:05 -08:00
Stephane Wirtel
8a0977a12c fix typo 2013-02-07 16:35:49 +01:00
Dmitry Medvinsky
25e22e31df Use getattr with default instead of if hasattr/else 2013-01-08 18:23:14 +04:00
benoitc
31e259ea97 say hello to 0.17.2 2013-01-06 18:56:56 +01:00
Qiangning Hong
ec7f75f48f optimize readline()
Use less memory when processing file uploading, to be fast and safe
2013-01-06 18:49:30 +01:00
benoitc
eb73681181 make import errors more visible
fix #461
2013-01-06 12:47:06 +01:00
benoitc
8ab090aafb don't remove the file under cygwin.
Thanks to @pombredanne for the report. fix #407
2013-01-06 08:23:36 +01:00
benoitc
84d9f4c604 don't pass ssl_options if there are any.
some versions of tornado fail when passing empty ssl options. This
change fix it.

fix #465
2013-01-06 08:12:40 +01:00