Benoit Chesneau
27df1339ce
Merge pull request #1071 from wosc/1061-log-uri
...
Include request URL in error message.
2015-07-08 20:55:34 +02:00
Berker Peksag
dddfcb2826
Fix test_logger in Python 3.2.
2015-07-08 12:38:14 +03:00
Berker Peksag
117ef10176
Add Python 3 support to _get_user().
2015-07-08 12:15:38 +03:00
Wolfgang Schnerring
79011d0c4a
Include request URL in error message.
...
Fixes #1061 .
2015-07-08 10:18:26 +02:00
Slava Shklyaev
531133615e
Prefix config file with its type
2015-07-08 09:21:32 +03:00
Viacheslav Biriukov
5f3dc8ed2b
getting username from basic auth header for access logs
2015-07-07 23:32:13 +03:00
Krzysztof Urbaniak
66a0fdfd4f
add support for gevent on python3
2015-07-04 02:38:54 +02:00
Gaurav Jain
eed65c63f1
PEP8 fixes
2015-06-22 03:10:52 -07:00
Gaurav Jain
09007c7f0a
Catch OSError as well as ValueError on race condition
...
The fix for issue #863 was incomplete as both OSError or ValueError could be
raised by os.fstat(). Thus we need to catch both types of exceptions
2015-06-22 03:10:30 -07:00
Brijesh Bittu
80e93b9c55
Updated gunicorn/pidfile.py
...
Added a try block to convert the contents of the `pidfile.py` if it can be converted to integer or not. If not, then `wpid` is assigned 0 and the `validate` function returns as usual. If the pidfile has a valid int, the function continues to kill the process as before.
2015-06-04 12:48:03 +05:30
Berker Peksag
5a8b9555da
Tweak markup of the sendfile documentation a bit.
2015-05-29 06:52:19 +03:00
Steven Maude
ad07bccb4e
Fix comment typos
...
In wsgi.py
2015-05-27 14:29:12 +01:00
Berker Peksag
e1aa8068e4
Merge pull request #1033 from ccl0326/master
...
make graceful shutdown thread-safe
2015-05-23 15:49:20 +03:00
陈程龙
d9b89599cc
make graceful shutdown thread-safe
2015-05-23 19:00:38 +08:00
Jarmo Hekkanen
826ef2d151
Fix self.nr usage in ThreadedWorker so that auto restart works as expected
2015-05-16 00:36:55 +03:00
Berker Peksag
95b5f78ecb
Backport urlparse.urlsplit from Python 2.7 to Python 2.6.
...
urlsplit doesn't reject invalid IPv6 addresses in Python 2.6.
2015-05-10 10:40:32 +03:00
Berker Peksag
b951175c66
Raise InvalidRequestLine instead of ValueError if the line contains malicious data.
...
Closes #1023
2015-05-09 19:12:58 +03:00
Berker Peksag
a7354cf8fe
Merge pull request #1010 from krallin/fix-statsd-py3
...
Fix statsd Logging in Python 3
2015-04-30 15:54:48 +03:00
Thomas Orozco
410bcfa6e1
Fix statsd logging to work on Python 3
...
Bytes must be passed to socket.send.
Update tests to ensure an actual socket is used, so that errors like
this can be caught in unit tests in the future.
2015-04-30 14:07:03 +02:00
Toby Sullivan
11ee135b40
Fix argument to disable sendfile
2015-04-29 17:40:31 -07:00
Vlad Dragos
342512a128
Add the 'gthread' worker to the gunicorn.workers.SUPPORTED_WORKERS dictionary
...
Fixes #1011 .
2015-04-22 16:41:45 +03:00
Ryan Petrello
5e5e0fd6cf
Retry socket binding up to five times upon EADDRNOTAVAIL.
2015-04-07 22:06:26 -04:00
wong2
81f65c2858
extract to a method
2015-03-18 19:18:15 +08:00
wong2
1f8d3b6c37
use self.cfg.reload
2015-03-18 18:52:54 +08:00
wong2
250d98f48a
fix for review
2015-03-14 23:28:24 +08:00
wong2
d03891a470
reloader should survive SyntaxError
2015-03-11 20:46:44 +08:00
Randall Leeds
3bb4de4dff
Actually expose the reloader
...
The reloader was not actually being stored on the worker.
2015-03-06 03:04:18 -08:00
Benoit Chesneau
e5d0e1505f
correct version is 19.3
...
since changes are added to the core, let's show it in versionning
2015-03-06 11:05:03 +01:00
Benoit Chesneau
39761603cd
bump to 19.2.2
2015-03-06 10:32:35 +01:00
Benoit Chesneau
30177b879a
make sure a listener is inheritable
...
fix #978
2015-03-06 10:17:26 +01:00
Benoit Chesneau
eb485d2134
make worker check_config method optionnal
2015-03-06 10:10:42 +01:00
Benoit Chesneau
e5f6b8024d
add check_config instance method to workers
...
Add a method to check if config requirements are OK for a specific worker by
adding the `check_config` instance method. This method takes 2 arguments: the
config instance followed by the logger instance to log.
This method is right now used in the thread worker to display a warning in
the case it can't handle keep alive connections. This change is related to #979 .
2015-03-06 10:01:31 +01:00
Benoit Chesneau
a459986cfd
like in threaded workers let some time to the vm to release locks
...
applied similar change to 8936d8274770bec5fced09b28eb687b23bef20c1
fix #981
2015-03-06 08:51:14 +01:00
Benoit Chesneau
803a2d71b0
fix select timeout in sync worker with multiple connections
...
fix #983
2015-03-06 08:35:17 +01:00
Berker Peksag
d376b6f78a
Raise TypeError instead of AssertionError.
...
assert statements will be removed if you run Python
in optimized mode (e.g. with -O flag).
2015-02-23 00:35:47 +02:00
Randall Leeds
b6430c36a9
Set self.reloader for hooks
...
This gives hooks that can access the worker access to the reloader,
useful for adding additional watched files.
Close #984
2015-02-17 12:46:02 -08:00
Berker Peksag
b8cdfaaccd
Make Logger.loglevel a class attribute.
...
This way it will be easier to change log level of a custom
Logger class:
class MyLogger(gunicorn.glogging.Logger):
loglevel = logging.WARNING
2015-02-06 08:48:11 +02:00
benoitc
48b36fb71f
bump to 19.2.1
2015-02-04 14:43:57 +01:00
benoitc
8b6d86ef2b
fix debug mode in gaiohttp worker
...
The debug setting has been removed and now only the debug level can be used to know if
we are in debug mode or not. This change update the gaiohttp worker to handle
that. While I'm here, expose the loglevel from the Logger class.
fix #977
2015-02-04 14:31:00 +01:00
Randall Leeds
48cdfcc267
Merge pull request #972 from berkerpeksag/small-impr
...
Small improvements
2015-02-02 12:48:02 -08:00
Berker Peksag
f22267a1be
Fix gunicorn.http.__all__.
...
All parameters should be a str type.
2015-01-30 22:30:56 +02:00
Berker Peksag
6db35f66a3
Make mesg_class a class attribute.
2015-01-30 22:14:34 +02:00
benoitc
8936d82747
clean threads before exiting
2015-01-30 06:53:11 +01:00
Berker Peksag
d49d40097a
Combine logging section in gunicorn/config.py.
...
Fixes #969 .
2015-01-26 18:56:49 +02:00
Benoit Chesneau
fa1b7cc828
Merge pull request #962 from benoitc/fix/908
...
stop to accept more requests when maximum accepted is achieved
2015-01-21 23:27:24 +01:00
benoitc
b1bde15113
check if the parent is alive
2014-12-21 09:41:09 +01:00
benoitc
1f92511430
make sure we can alwas accept connection.
...
This is done by limiting the number of kept alived requests to MAX WORKER
CONNECTIONS - N Threads so at any time we can accept N connection.
2014-12-20 16:52:22 +01:00
benoitc
fcd9d04515
stop to accept more requests when maximum accepted is achieved
...
this change makes sure that a worker don't handle more requests than it can
achieved. The new workflow is quite more simple:
listeners are put in the poller. On read we try to accept on them.
When a connection is accepted it is put in the execution queue
When a request is done and the socket can be kept alived, we put it in the
poller, on read event we will try to handle the new request. If it is not put
out of the poller before the keepalive timeout the socket will be closed.
if all threads are busy we are waiting until one request complet. If it
doesn't complete before the timeout we kill the worker.
fix #908
2014-12-20 11:16:58 +01:00
Randall Leeds
c3b0f9f59a
Let the reloader kill the worker by signal only
...
There is no reason to raise a `SystemExit` because the reloader thread
will die when the worker exits anyway. Having this exception can cause
tracebacks during interpreter shutdown (#910 ).
Close #910
2014-12-19 17:19:51 -08:00
Randall Leeds
d53ac880b2
Merge pull request #959 from benoitc/test/gh942-remove-timeout
...
remove dynamic timeout temporarely
2014-12-19 10:14:53 -08:00