956 Commits

Author SHA1 Message Date
Randall Leeds
6bac0216aa add util.closerange using os module or fallback 2011-09-19 13:42:07 -07:00
Randall Leeds
612a895b15 fix up ugly attribute use in ggevent 2011-09-19 13:41:23 -07:00
Randall Leeds
f7dd412bc3 Merge pull request #257 from tilgovi/master
some improvements to gevent code
2011-09-19 13:35:27 -07:00
Randall Leeds
d6915942f7 factor out duplicate gevent-based worker code 2011-09-18 03:50:13 -07:00
Randall Leeds
55de904e9d add access logging for gevent_* workers 2011-09-18 03:50:13 -07:00
Randall Leeds
04680f1020 fix inverted request_time computation 2011-09-18 02:13:01 -07:00
benoitc
2976618dd3 bump to 0.13.2 2011-09-17 11:03:42 +02:00
benoitc
939b261fed update doc & news for 0.13.2 release. 2011-09-17 10:59:50 +02:00
Randall Leeds
105558595b fix #247 - gunicorn doesn't work with Tornado 2.0 2011-09-15 17:49:19 -07:00
Randall Leeds
4633d1aad9 keep graceful shutdown from interrupting workers
When the signal.siginterrupt call is available it can be used to make
interrupted system calls (errno == EINTR) retry transparently whenever
they have not caused any side effects yet (e.g. no data read/written).
It should make shutdown more graceful.

Patch by Jonas Borgström
2011-09-15 16:20:06 -07:00
Kristian Øllegaard
ba730b1f18 In reload_django_settings "re" is used, but not imported.
fix issue #250. Thanks!
2011-09-15 22:13:55 +02:00
benoitc
ea6abf75b2 typo. fix issue #252. 2011-09-12 17:15:45 +02:00
benoitc
f2a44431bd fix logging in sync worker 2011-09-09 02:16:03 +02:00
benoitc
1d353c993b typo . spotted by adamJLev on github thanks! 2011-09-09 02:04:48 +02:00
benoitc
571a5309d1 - add request time support in log access
- make log access format customizable in settings:
- fix logger

To setup a log format use the --access-logformat option.

        By default:

        %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"

        h: remote address
        t: date of the request
        r: status line (ex: GET / HTTP/1.1)
        s: status
        b: response length or '-'
        f: referer
        a: user agent
        T: request time in seconds
        D: request time in microseconds

        You can also pass any WSGI request header as a parameter.
        (ex '%(HTTP_HOST)s').
2011-09-09 01:44:31 +02:00
benoitc
824801d017 make the Logger pluggable. Allows people to use their own logger by
giving to gunicorn an entry point or a module path.
2011-09-09 00:43:00 +02:00
benoitc
2375ca87fe fix issue #244. lats change in post_request arity was breaking some apps
and also wasn't working everywhere. This patch wrap the function if
arity != 3 so we don't have to test its arity each time we use it.
2011-09-09 00:11:02 +02:00
Randall Leeds
4009c942df add Chris Lamb to THANKS 2011-09-08 11:47:37 -07:00
Randall Leeds
0b6a03f9d6 Merge pull request #248 from lamby/master
Add Debian installation instructions.

Thanks Chris Lamb
2011-09-08 11:47:01 -07:00
Randall Leeds
46791fd496 fix #236 - drop debian packaging dir 2011-09-08 11:45:57 -07:00
Kristian Øllegaard
e8aaf84c63 A fix to make the newest gunicorn work with older projects, that doesn't have LOGGING_CONFIG 2011-09-08 10:54:57 +02:00
Chris Lamb
adc39a9adc Add Debian installation instructions.
Signed-off-by: Chris Lamb <lamby@debian.org>
2011-09-07 11:53:07 +01:00
benoitc
ada725fae0 sometimes it return 0 and we need it. 2011-08-25 13:38:30 +02:00
benoitc
c3c695d462 fix typo 2011-08-25 13:38:00 +02:00
benoitc
f4f73b6d09 updated news 2011-08-22 16:46:57 +02:00
benoitc
953021d449 proper fix. ":w" helps. 2011-08-22 16:43:15 +02:00
benoitc
e3617e3b38 bump to 0.13.1. 2011-08-22 16:40:44 +02:00
benoitc
94f39e9d5e fix unix socket. spotted by @jinzo on irc. Thanks! 2011-08-22 16:38:12 +02:00
benoitc
eac1812f36 update debian changelog (for ppa) 2011-08-22 15:11:51 +02:00
benoitc
39937914c3 fix post_request config 2011-08-22 14:11:39 +02:00
benoitc
8c35e48e7e 0.13 release news. 2011-08-22 14:10:28 +02:00
benoitc
428c7a3b5e put back logging confing in gunicorn_paster. spotted by @oit on github.
thanks!
2011-08-22 09:45:06 +02:00
Randall Leeds
25e79ffe6d add Phil Schanely to THANKS 2011-08-22 09:45:06 +02:00
Phil Schanely
d6560726c5 New on_reload server hook to customize how SIGHUPs spawn new workers. 2011-08-22 09:45:06 +02:00
Randall Leeds
4879005cc1 backwards-compatible support for --error-logfile 2011-08-22 00:08:34 -07:00
Randall Leeds
1e618c512e add denik to THANKS 2011-08-21 22:47:35 -07:00
Denis Bilenko
32862a694a when stopping the arbiter, close the listener asap
setting self.LISTENER to None is not enough because
self.WORKERS also have references to it
2011-08-21 22:47:35 -07:00
Randall Leeds
388612f628 fix typo in glogging module 2011-08-21 22:47:35 -07:00
Randall Leeds
1ebf60fbc3 reopen logs on USR1 to master 2011-08-21 22:47:35 -07:00
benoitc
66f7271c5f Use our own logger object to log events in gunicorn. While I'm here add
the possibility to manage an access log compatible with apache combined
log format. reopening files is also handled. Also, this change fix
issues #237 and #190.

For the sake of simplicity logging file have been removed

--logfile option has become --error-logfile, by default "-"

Following options have been added:

--access-logfile, the access log file path. By default None. If set
access logs will bre written to defined output

eg:

$ gunicorn -w3 --access-logfile=- test:app
2011-08-21 19:36:52 [84572] [INFO] Starting gunicorn 0.13.0
2011-08-21 19:36:52 [84572] [INFO] Listening at: http://127.0.0.1:8000
(84572)
2011-08-21 19:36:52 [84572] [INFO] Using worker: sync
2011-08-21 19:36:52 [84573] [INFO] Booting worker with pid: 84573
2011-08-21 19:36:52 [84574] [INFO] Booting worker with pid: 84574
2011-08-21 19:36:52 [84575] [INFO] Booting worker with pid: 84575
127.0.0.1 - - [21/Aug/2011:19:37:04] "GET / HTTP/1.1" 200 14 "-"
"curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r
zlib/1.2.5"
2011-08-21 21:08:58 +02:00
benoitc
325c5a8f40 bump version to 0.13.0 2011-08-21 10:22:10 +02:00
benoitc
0c31bfea8a like we do for 304 do the same for 204. fix issue #194. 2011-08-21 07:57:12 +02:00
Brian Rosner
6dc33b1ca4 When the response is a 304 turn off chunked responses as there is a guarantee there is no response body (hence no Content-Length defined)
This can cause odd behavior with browsers not being able to parse the response
correctly (not sure if this is just a property of empty chunked responses or
something else)
2011-08-21 07:56:09 +02:00
Anand Chitipothu
5aabdc0ae2 Preserve semicolons in the path. #215
`urlparse.urlparse` splits the url at semicolons and calls it params. Since
the WSGI doesn't have any special treatment for params, they should be
preserved and passed to the wsgi app. Using `urlparse.urlsplit` to
avoid splitting the params.
2011-08-21 07:41:44 +02:00
benoitc
17b47a376b get settings module name on fork rather than on app initialization. It
allows people to use relative path in their projects. fix issues #219,
and #213
2011-08-21 07:31:58 +02:00
benoitc
f593922bb0 let post_request accept the environ. 2011-08-02 18:01:35 +02:00
Randall Leeds
21f7282128 remove redundant exception handling an async base
StopIteration is simply propogated, so there's no reason to catch it.
The catch-all exception is also caught and logged in handle(), but
broken pipe errors are ignored. The redundant catch here was generating
excess logging by calling handle_error for a broken pipe which fails to
send the error because the client has already disconnected.
2011-07-08 14:38:32 -07:00
benoitc
4c2267b0a1 fix issue #229, put the rigt order for fdout and fdin. 2011-07-06 21:30:45 +02:00
John Hensley
7e9f8b5b02 Change handling of headers that indicate SSL requests.
Instead of hardcoding X-Forwarded-Protocol and X-Forwarded-SSL, make the
header and value configurable, with no default that would enable a
client to spoof secure requests if the reverse proxy is not configured
to strip the header used.
2011-07-06 18:33:17 +02:00
benoitc
1a796ebbc6 fix issue #221 don't override sys.path if project_path is already in. 2011-07-06 17:40:17 +02:00