44 Commits

Author SHA1 Message Date
Oliver Tonnhofer
06bf4b67c1 Fix missing errno import for eventlet sendfile patch 2013-12-09 10:11:47 +01:00
benoitc
308081948f fix eventlet worker
make sure we patch the listening socket in the worker
2013-11-04 14:46:31 +01:00
benoitc
f2920bfcda monkey patch in the worker
this change move the monkey patching from the aribiter to the worker so we make sure the supervision won't be altered.

fix #478
2013-11-04 14:26:05 +01:00
benoitc
7e40442978 simplify the eventlet worker.
sockets are a;lready greened. make sure we also switch to the acceptor quickly.
2013-08-27 23:49:18 +02:00
benoitc
1eceed0ad5 monleypatch sendfile for the eventlet worker
makesure sendfile isn't blocking on eventlet
2013-08-27 18:32:33 +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
Adnane Belmadiaf
20cd49595a PEP8 fixes 2012-12-24 09:53:03 +01:00
Adnane Belmadiaf
fa37b90ad8 Append acceptors in EventletWorker 2012-12-21 15:46:00 +01:00
benoitc
1198cc2723 handle ssl connections.
gunicorn is now supporting ssl connections:

    $ gunicorn -w3 --certfile=server.crt --keyfile=server.key test:app

works with all supported workers
2012-12-14 10:22:05 +01:00
benoitc
b7b51adf13 allows gunicorn to bind to multiple address
Allows gunicorn to listen on different interface. It can be either ipv6,
unix or ipv4 sockets.

Ex:

    gunicorn -w3 -b 127.0.0.1:8001 -b 127.0.0.1:8000 -b [::1]:8000 test:app

fix #444
2012-12-14 10:18:39 +01:00
Caleb Brown
2300c90b8d If keepalive is 0 use None so the timeout is ignored. 2012-06-06 09:59:21 +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
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
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
f168a21dae fix whitespaces 2012-02-19 11:27:46 +01:00
WoLpH
179b87639c removed python string formatting from logging to enable log message grouping 2011-05-11 23:11:36 +02: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
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
66cc6975d1 useless log. 2010-09-02 21:59:02 +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
87296d5bc6 fix an issue. found when reviewing Jonas Borgströ patch. thanks! 2010-08-24 19:50:23 +02:00
benoitc
3979c3dd40 bump 2010-08-12 13:52:00 +02:00
benoitc
b281ec002b fix worker timeout. 2010-08-12 13:10:56 +02:00
benoitc
5df427b5cb oups 2010-08-12 12:22:54 +02:00
benoitc
7300502605 dramatically improve eventlet worker 2010-08-12 12:18:41 +02:00
benoitc
ed66b8b129 some fixes 2010-08-12 11:30:07 +02:00
benoitc
1ac15b4bb2 some fixes in eventlet worker 2010-08-11 18:27:07 +02:00
benoitc
cf6747dd86 fix gevent & eventlet workers 2010-08-11 17:00:03 +02:00
benoitc
2ddbe800a5 clean a little the eventlet worker 2010-08-11 14:08:32 +02:00
benoitc
9af95b7f8d osi.waitpid patching is broken in eventlet and prevent arbiter to exit.
Waiting upstream fixes, don't patch it for now.
2010-07-08 19:30:55 +02:00
benoitc
acd8d57c9f patch all so we make sure io are patched too 2010-06-03 16:11:57 -04: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
Paul J. Davis
eb0d54e111 Added monkey patch for threading. 2010-06-02 12:16:00 -04:00
Paul Davis
08773bb654 Fix eventlet epoll error. 2010-06-01 15:26:13 -04: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
benoitc
2bc67cc8b8 better handling of QUIT/HUP soignal to fix issue #49. We want graceful
quit or restart if possible.
2010-05-10 12:25:34 +02:00
benoitc
5b2f98fca4 fix erros spotted by pyflakes 2010-04-22 19:41:29 +02:00
benoitc
090bb8fe29 add timeout support 2010-04-22 19:07:23 +02:00
benoitc
8184eb493c add refactor gevent support like we did on eventlet. In the future it
may be better to use Event object. While i'm here move the monkey
patching in its own function used on config so we make sure to patch
only one time and prevent some ugly hack like reinit gevent each time we
spawn (it's better to use patched os.fork from gevent once time).
2010-04-22 14:38:49 +02:00
Paul J. Davis
0c935d06c7 Got the Sync and Eventlet workers running. 2010-04-15 21:20:17 -04:00
Paul J. Davis
51f1f22665 Refactoring worker code.
Also went through gunicorn.main lightly.
2010-04-15 20:08:28 -04:00