777 Commits

Author SHA1 Message Date
Konstantin Kapustin
4fdfc3a76b Fix LimitRequestLine check. 2012-08-20 16:02:52 +04:00
Djoume Salvetti
97b43bd20a Create a pidfile before executing on_starting().
This will let a standard init script (or any script that look for a
pidfile) know that gunicorn is already running and won't attempt to run
it twice.
This would also enable the script to stop gunicorn even in it's startup
phase.
2012-08-03 21:27:36 +02:00
benoitc
4b478e1a66 fix request line check. close #390
We never had the possibility to check the limit since we were quitting
the loop before it.
2012-08-03 06:27:26 +02:00
benoitc
3cd1a9acd9 log it as an exception 2012-08-03 06:04:08 +02:00
benoitc
acb3c5a817 bump to 0.14.6 2012-07-26 23:48:48 +02:00
benoitc
4d70a526f2 fix typo 2012-07-13 18:13:19 +02:00
Paul J. Davis
489e935038 Fix request line length check
We were accidentally including partial data when we didn't find the
request line terminating '\r\n'. This changes the check to make sure
we're testing the length after we assert there's no termination.
2012-07-04 15:53:10 -05:00
benoitc
5615464923 handle keepalive = 0
Keepalive=0 means that we aren't waiting for the next connection. So
make sure to send appropriate "close" header and that we handle the first
connection.
2012-07-04 09:34:12 +02:00
benoitc
cdd3e1dc2b check parents if we are in the worker. fix #348 2012-06-27 08:08:57 +02:00
benoitc
5b0e8f9011 bump to 0.14.5 2012-06-24 18:16:48 +02:00
benoitc
67bd75f7b3 don't try to reopen files on initial startup. fix #358 2012-06-24 17:25:43 +02:00
benoitc
b85cf2852b close #365 2012-06-24 12:13:05 +02:00
Konstantin Kapustin
9dba6bf7ec Small correct for handle_error.
1. client.getpeername() can raise "error: [Errno 107] Transport endpoint
is
not connected" if a client has unexpectedly disconnected.

2. I guess we do not need worry about sending error message to client.
2012-06-24 11:29:04 +02:00
benoitc
12a0e55bcf Revert "fix issue #348 ."
This reverts commit da637dfd13b520fc190b86967dfecc06bf97a2b4.
2012-06-19 10:31:06 +02:00
benoitc
a68618c824 breaking change: take the control on graceful reload back
We really shouldn't allow the people to override the way we spawn the
new workers on reload. Graceful is about launching new worker and kill
olders after the graceful time.
2012-06-18 11:02:30 +02:00
benoitc
da637dfd13 fix issue #348 .
Rather than testing the parent pd, test if the parent pid is still
alive. Only use it in gevent for now.
2012-06-14 22:56:58 +02:00
Caleb Brown
d7caa526e5 If keepalive is 0 use None so the timeout is ignored. 2012-06-06 09:57:11 +02:00
benoitc
0577135a76 apparently gevent doesn4t import gevent.core now 2012-06-04 23:41:53 +02:00
benoitc
cd3f9f076e logs are already reopened in self.setup 2012-06-04 11:55:29 +02:00
benoitc
188fa3e109 add the graceful timeout option. close #352
This change add gtraceful timeout option. This timeout is different than
the worker timeout and can be extended to handled a longer delay before
closing a running connection.

Patch based on the one given by @sirkonst with some edit + support of
the eventlet worker.
2012-06-01 09:07:43 +02:00
414nch4n
a42daa03ed fix tornado.wsgi.WSGIApplication calling error 2012-06-01 08:56:38 +02:00
benoitc
2cdc7a9cfb always load the application if possible. fix #358 2012-06-01 08:34:18 +02:00
benoitc
5e37c89017 don't try to set the script as the process group. fix #355
Setting gunicorn as the process group prevent exit from the shell.
2012-05-25 13:40:29 +02:00
Konstantin Kapustin
3ff895d735 Added missing LimitRequestLine and LimitRequestHeader. 2012-05-25 12:52:02 +02:00
benoitc
ffecd64669 don't finish the loop if the headers length is too big 2012-05-25 12:27:40 +02:00
benoitc
d79ff999ce fix multiple issues with request limit
patch from Djoume Salvetti . address the following issues in gunicorn:

* Gunicorn does not limit the size of a request header (the
* limit_request_field_size configuration parameter is not used)

* When the configured request limit is lower than its maximum value, the
* maximum value is used instead. For instance if limit_request_line is
* set to 1024, gunicorn will only limit the request line to 4096 chars
* (this issue also affects limit_request_fields)

* Request limits are not limited to their maximum authorized values. For
* instance it is possible to set limit_request_line to 64K (this issue
* also affects limit_request_fields)

* Setting limit_request_fields and limit_request_field_size to 0 does
* not make them unlimited. The following patch allows limit_request_line
* and limit_request_field_size to be unlimited. limit_request_fields can
* no longer be unlimited (I can't imagine 32K fields to not be enough
* but I have a use case where 8K for the request line is not enough).

* Parsing errors (premature client disconnection) are not reported

* When request line limit is exceeded the configured value is reported
* instead of the effective value.
2012-05-24 12:13:34 +02:00
benoitc
124963249a bump version 2012-05-16 08:47:29 +02:00
benoitc
1faea03263 found the settings file in eahc nested folders. Fix issue #340 2012-05-16 08:45:35 +02:00
benoitc
8835b5f04d break immediately if we found the project path. 2012-05-16 08:23:07 +02:00
benoitc
09a4a8374d bump to 0.14.3 2012-05-15 09:57:48 +02:00
benoitc
1efb622938 the app was initialized 2 times. close #324
thanks @fafhrd91 for the diff
2012-05-15 00:21:43 +02:00
benoitc
da11bce9a7 detect if AdminHandler can be imported. close #333 2012-05-14 23:17:12 +02:00
Djoume Salvetti
9e308e317f Improves performance of http.body.Body.readline() 2012-05-10 11:24:54 +02:00
Benoit Chesneau
4b59fc351f fix typo 2012-04-26 18:30:01 +02:00
Benoit Chesneau
5f11713678 log HTTP errors in access log. close #317 2012-04-26 18:17:55 +02:00
Benoit Chesneau
1c27d369b4 display traceback when the work fails to boot (close #338) 2012-04-26 17:40:09 +02:00
Benoit Chesneau
8c716dd110 Merge pull request #332 from vibrant/master
random.seeding is broken if urandom is absent
2012-04-26 08:27:57 -07:00
Randall Leeds
dd948d6f46 better support for new and old gevent dns
Thanks @denik. Fixes #336.
2012-04-22 20:11:34 -07:00
Benoit Chesneau
6cffb5b473 no mre AdminMediaHandler class in django 1.4 . close #333 2012-04-17 14:07:36 +02:00
Wojtek
62ee0859bc fixed random number generation in case of urandom absence 2012-04-12 13:46:51 +02:00
Bobby Beckmann
6630c5e3e1 Makes gunicorn work with gevent 1.0b2 2012-04-11 15:30:35 -05:00
Randall Leeds
1757567d2f Be careful with logging locks and unopened streams
Slight modification of patch suggested by sirkonst.
2012-03-27 17:14:29 -07:00
Konstantin Kapustin
ac223ae639 Change logging in handle_error. 2012-03-27 17:01:40 -07:00
Randall Leeds
4a01269871 doc fix: log to '-' means stderr 2012-03-27 14:32:58 -07:00
benoitc
573ad019d1 fix websockets supports.
Thanks Nikolay Kim for the tests and patch.
2012-03-26 18:20:30 +02:00
benoitc
ff1dfa1780 reopen log files after initialization . close #309
make sure we reopen logfiles after initialization so we are sure we can
use it.
2012-03-24 09:46:05 +01:00
Chris Forbes
feb200d807 Fix typo in docstring for kill_workers 2012-03-20 15:53:32 +13:00
benoitc
a6460199a3 bump to 0.14.2 . 2012-03-16 21:10:53 +01:00
benoitc
961eabb332 simplify the code 2012-03-16 21:10:44 +01:00
benoitc
d6012fa84b fix gevent_pywsgi worker. close #314
access_log arity has changed in 0.14.0. Apply this change to the pywsgi
worker as well.
2012-03-16 07:18:30 +01:00