924 Commits

Author SHA1 Message Date
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
benoitc
0f53a83f49 main problem of current run_gunicorn reload behaviour is that settings
aren't correctly reloaded. First attempt to remove it from sys.modules
introduced more problem than it solved.

This new attempt, just get the module, reload it and populate currently
loaded settings with new values.
2011-06-25 10:28:27 +02:00
Keegan Carruthers-Smith
133a85e4ee Updated docs to reflect the proper alternative syntax for specifying a worker class. 2011-06-25 09:19:05 +02:00
Jim Garrison
087647dc88 fixed spelling of _sendfile 2011-06-25 09:13:08 +02:00
Paul J. Davis
9d65513f33 Disable attempt at reloading Django modules.
This appears to be causing errors in user code so we decided
to disable it until we can find a cause or better method for
reloading Django.
2011-06-15 19:31:07 -04:00
Paul J. Davis
0923a52171 Fix bug in Arbiter.manage_workers.
My fix yesterday was broken when sorting workers. Thanks to
Sabin Iacob for the report.
2011-06-15 09:20:20 -04:00
Paul J. Davis
6d69509bb6 Avoid race condition in dict iteration.
Its possible that when iterating Arbiter.WORKERS in manage_workers we
get interupted to handle a SIGCHLD which will pop the child PID from
the dict which results in a "dict changed size while iterating
error. Reported on IRC. Simple fix is to just copy the dict into a
list that we iterate.
2011-06-14 16:17:47 -04:00
Paul J. Davis
e1e634a8aa Fixed Tornado worker exiting.
Thanks to Masahiro Nakagawa for the report and patch.

Fixes #216
2011-06-06 06:34:14 -04:00
Paul J. Davis
7ffa097cf7 Use split (not rsplit) to separate MOD:APP info. 2011-06-02 09:17:59 -04:00
benoitc
fc300cc23c update doc 2011-05-18 19:08:02 +02:00
benoitc
76aef105d5 fix django example to work with 1.3 . 2011-05-18 18:22:55 +02:00
WoLpH
179b87639c removed python string formatting from logging to enable log message grouping 2011-05-11 23:11:36 +02:00
benoitc
980792c8af add Michael Schurter to THANKS 2011-05-11 23:11:03 +02:00
Michael Schurter
1a52dd2d84 Remove unneeded lambda 2011-05-11 23:11:03 +02:00
benoitc
6fa1c52aaa fix import. 2011-05-11 23:11:03 +02:00
benoitc
78e3d08f96 add missing GeventWSGIWorker 2011-05-11 23:11:03 +02:00
benoitc
d79b2dce3f add Denis Bilenko to the thanks 2011-05-11 23:11:03 +02:00
denis
70b962e626 fix typo catched by pyflakes 2011-05-11 23:11:03 +02:00
denis
2ab4bbf46f fix compatibility with gevent 0.14 dev version
Move "import gevent.wsgi" into a separate module, which is not
imported if pywsgi worker is requested. (The gevent.wsgi currently
not provided by gevent trunk but pywsgi works fine.)
2011-05-11 23:11:03 +02:00
Aaron Kavlie
c74894f2a1 Added details on using runit to the site's deploy section. 2011-05-11 23:11:03 +02:00
benoitc
4ecc1441b9 i hate my kbd. Real fix 2011-05-11 23:11:03 +02:00
benoitc
a65bf395ae fix fbsd support 2011-05-11 23:11:02 +02:00
benoitc
c17f7230e8 refactor sendfile and add an example. 2011-05-11 23:11:02 +02:00
benoitc
fc69d5e17c useless debug info 2011-05-11 23:11:02 +02:00
benoitc
fcab6bc144 after multiple attempts it's easier to just reload the app. People using
mange.py have to use USR2 signal if they want to upgrade the django
version instread of HUP. On the other hand, upgrading django version
with HUP is possible with gunicorn_django command.
2011-05-11 23:11:02 +02:00
Paul J. Davis
6e13a0fcd9 Fixed another typo in the runit script. 2011-05-11 23:11:02 +02:00
Paul J. Davis
e22daee056 Fixed typo in deploy docs. 2011-05-11 23:11:02 +02:00
Paul J. Davis
4211be4df4 Reorder hook config section to be more logical. 2011-05-11 23:11:02 +02:00
Paul J. Davis
4ca391c0c7 Regenerate site content. 2011-05-11 23:11:02 +02:00
Paul J. Davis
9e6631e832 Fix hook function names.
The names were being rendered into the online docs and
causing confusion.
2011-05-11 23:11:00 +02:00
Paul J. Davis
d83c63429e Empty chunks incorrectly signal end of response.
If an app iterator attempts to send an empty string to the client
while using chunked transfer encoding it incorrectly signals the
end of the transfer. This patch just ignores empty strings that
are yielded by the application.
2011-05-11 23:09:55 +02:00
Paul J. Davis
c71b9a88c2 Use the newer cpu_count method in docs.
Updated docs to show the use of the cpu_count function in the
multiprocessing module.

Thanks to Fabian Topfstedt for the update.

Fixes #202
2011-04-25 11:23:56 -04:00
benoitc
0b094ca08a fix issue #195. Thanks! 2011-04-24 09:32:55 +02:00