56 Commits

Author SHA1 Message Date
benoitc
12a0e55bcf Revert "fix issue #348 ."
This reverts commit da637dfd13b520fc190b86967dfecc06bf97a2b4.
2012-06-19 10:31:06 +02:00
benoitc
e78d19019d apparently gevent doesn4t import gevent.core now 2012-06-06 09:59:21 +02:00
benoitc
118c571898 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-04 21:17:11 +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
Randall Leeds
dd948d6f46 better support for new and old gevent dns
Thanks @denik. Fixes #336.
2012-04-22 20:11:34 -07:00
Bobby Beckmann
6630c5e3e1 Makes gunicorn work with gevent 1.0b2 2012-04-11 15:30:35 -05: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
benoitc
1319543448 use the cached app. 2012-03-01 08:02:15 +01:00
benoitc
c7a0af5d3a make the django monkey patching less intrusive.
only patch in the `run_gunicorn` command.
2012-02-21 16:48:43 +01:00
benoitc
fa341c6531 pyflakes pass. 2012-02-21 14:53:17 +01:00
benoitc
161c8c03cb monkey patch django. close #293 .
This patch make sure that we use real threads to get the ident which is
going to happen if we are using gevent or eventlet.
2012-02-21 14:24:55 +01:00
benoitc
b2c83b2bc3 fix whitespaces. 2012-02-21 14:23:52 +01:00
benoitc
860895c03d fix typo 2011-09-19 23:18:18 +02:00
Randall Leeds
612a895b15 fix up ugly attribute use in ggevent 2011-09-19 13:41:23 -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
WoLpH
179b87639c removed python string formatting from logging to enable log message grouping 2011-05-11 23:11:36 +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
benoitc
ba89a400dc we don't do anythiung in __init__, remove these lines. 2011-03-03 10:36:14 +01:00
benoitc
16fd5d3c20 remove some useless code. pyflakes my friend. 2010-12-22 19:52:34 +01:00
Paul J. Davis
07f0c0f21d Fixes signal reaction times.
After messing around trying to make this more elegant we've decided to
just slap a 1s poll to the thing which seems to fix various bugs in the
async event handling.
2010-12-20 08:15:45 -05:00
benoitc
2e39db265c rather than sleeping the timeout, just test if time is elapsed, then
notify. Speed graceful reload and exit.
2010-12-12 22:57:50 +01:00
benoitc
a8e34ac16c send appropriate error status on http parsing. Fix issue #132. 2010-12-12 14:16:31 +01:00
benoitc
95a4af2a9c display the right error when a worker can't be used. 2010-10-28 06:13:57 +02:00
benoitc
939b459c38 don't notify so much the arbiter. spotted by @davisp & @prencher . tests are ok. 2010-10-28 06:13:45 +02:00
benoitc
7715199b48 it's better to test when you use the right code to do it. We had a
blocking operation django example (we read a file already on the fs and
recreate another which blocked async schedulers).

While I'm here ease the code of eventlet worker. Just use the convenient
eventlet.serve function which already manage what we do and revert sopme
useless changes in body and header parsing.
2010-09-02 14:55:56 +02:00
benoitc
8d089f95f9 workaround to prevent segfault with current gevent on osx. Disable
kqueue.
2010-09-01 11:30:20 +02:00
benoitc
5c498b6a89 do the same for others. 2010-09-01 10:30:30 +02:00
benoitc
c41d3edd36 notify before stopping. 2010-09-01 10:28:14 +02:00
benoitc
5ff6cd173f prevent GreenletExit exception. But we still have a warning :
http://code.google.com/p/gevent/issues/detail?id=41
2010-09-01 09:46:01 +02:00
benoitc
ed66b8b129 some fixes 2010-08-12 11:30:07 +02:00
benoitc
bf9d48be68 typo spotted by sjampoo on irc 2010-08-12 10:49:27 +02:00
benoitc
d2c10a95e4 dramatically improve the gevent worker. 2010-08-12 10:44:06 +02:00
benoitc
cf6747dd86 fix gevent & eventlet workers 2010-08-11 17:00:03 +02:00
benoitc
568f9c3ee1 new gevent worker. Use event to read on socket. Also don't notify so
often the fs
2010-08-11 16:28:18 +02:00
benoitc
80cd1f40ed don't use core.read_event it's not needed here since we balance only
when a connection come
2010-08-11 13:55:50 +02:00
benoitc
0616e30e90 clean exit 2010-08-11 13:20:02 +02:00
benoitc
e8bc2cdae8 row link should be set in acceptor not in _acceptor 2010-08-11 10:35:53 +02:00
benoitc
8b2a5c42f7 improve gevent worker. 2010-08-11 10:27:42 +02:00
Randall Leeds
dbd66b6191 work around evdns not playing well with fork 2010-07-22 14:26:37 -07:00
Benoit Chesneau
ae721f00d0 fix SERVER_PROTOCOL in WSGI environ and fix gevent one. 2010-07-16 12:49:23 +02:00
Paul Davis
d09f85edf0 Minor tweaks to new Gevent workers.
Just a slight rearangement and added some docs so I can remember which
worker is which in the future. Also renamed all occurrences of GEvent
to Gevent to have consistency.
2010-07-14 18:27:35 -04:00
Benoit Chesneau
8014555636 add full support for gevent. There is now 3 workers allowing us to use gunicorn with
gevent :
 - egg:gunicorn#gevent : gevent with gunicorn HTTP/WSGI parser
 - egg:gunicorn#gevent_wsgi : gevent.wsgi server
 - egg:gunicorn#gevent_pywsgi : gevent.pywsgi
2010-07-14 23:45:44 +02:00
benoitc
3b8e594200 remove this exit here 2010-07-08 18:55:13 +02:00
benoitc
46e8002ffc Fix a bug spotted while testin parser in restkit. 2010-06-26 22:53:18 +02:00
benoitc
a461817309 fix websocket with protocol 076. Fix from tom on irc. Thanks! 2010-06-24 16:20:48 +02:00
Paul J. Davis
bcaf21b62c Fix async worker integration. 2010-06-03 16:11:16 -04:00
Paul J. Davis
f02cbc10ed Playing with simplehttp. 2010-06-03 16:10:27 -04:00
benoitc
5038c3785a dns monkey patch is broken currently in gevent. Waiting upstream fix it,
don't patch it.
2010-05-12 17:54:37 +02:00
Paul J. Davis
0a46d09c6e Avoid a deadlock when the acceptor loop raises.
An out of file descriptors error was causing the async acceptor loops to
die. The notification process was unaffected so the workers didn't die.

Async workers hitting an error in the acceptor now kill themselves and
rely on the arbiter to restart a new worker in their stead.
2010-05-11 23:33:48 -04:00