[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-04-28 Thread Senthil Kumaran
Senthil Kumaran added the comment: Fixed in all codelines. Closing this. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset fb1e71c7619a by Senthil Kumaran in branch '2.7': Fix issue6085 - Remove the delay caused by fqdn lookup while logging in BaseHTTPRequestHandler http://hg.python.org/cpython/rev/fb1e71c7619a New changeset 6adad27fcc8c by Senthil Kumaran in branch '

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-04-28 Thread Senthil Kumaran
Senthil Kumaran added the comment: The original change was introduced in this issue401197 which seems to use fqdn at *all appropriate places*. In this case, after about a decade, it was realized that using fdqn for client connection may not be appropriate when hostname is not set. In 3.3, t

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-04-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 64a6824d129d by Senthil Kumaran in branch 'default': Fix Issue6085 - SimpleHTTPServer address_string to return client ip instead of client hostname http://hg.python.org/cpython/rev/64a6824d129d -- nosy: +python-dev ___

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-04-19 Thread Yuval Greenfield
Yuval Greenfield added the comment: I agree with Antoine on this. Though the suggested patch is wrong. I believe we should leave address_string alone. Simply stop the log_message method from using it. Either way we'd be changing the log format but if we don't have to then we shouldn't comple

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-02-25 Thread Charles-François Natali
Charles-François Natali added the comment: > +1 to Antoine’s proposal of removal. Agreed. Here's a patch. Do note, however, that it's a behavior change: the address_string() method is documented to return a resolved hostname (when possible). -- keywords: +needs review stage: test nee

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-02-24 Thread Éric Araujo
Éric Araujo added the comment: +1 to Antoine’s proposal of removal. -- nosy: +eric.araujo versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-02-24 Thread wmg
Changes by wmg : -- nosy: +wmgaca ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-02-13 Thread Ralf Schmitt
Changes by Ralf Schmitt : -- nosy: +schmir ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2011-03-28 Thread Charles-Francois Natali
Changes by Charles-Francois Natali : Removed file: http://bugs.python.org/file17081/base_http_server_fqdn_lag.diff ___ Python tracker ___ ___ P

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2011-03-28 Thread knickerkicker
Changes by knickerkicker : -- nosy: +knicker.kicker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-26 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: @santa4nt: You're correct, the cache is retained only from within the same handler: the other solution would be to keep the cache at the server level, but then you'd have to deal with the cache size (you don't want it to grow forever), and it seems a

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-26 Thread Santoso Wijaya
Santoso Wijaya added the comment: Please correct my understanding if I am mistaken, but from skimming through the source code, it seems that a new BaseHTTPRequestHandler is instantiated per request. If a caching mechanism is to be adopted as per the patch, wouldn't it be forgotten when a new

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-26 Thread Senthil Kumaran
Senthil Kumaran added the comment: On Mon, Apr 26, 2010 at 10:45:56AM +, Antoine Pitrou wrote: > What do you mean? BaseHTTPRequestHandler is tested in test_httpservers. I meant specifically for that function which is logging to sys.stderr. No return values, state changes and no tests prese

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: > And for this specific request, it fdqn is looked up only for "logging" > to sys.stderr. Either removing the fqdn call or just caching per > connection it as the patch does is both fine. I doubt if someone is > relying this logging anywhere in the code. This is

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-26 Thread Senthil Kumaran
Senthil Kumaran added the comment: And for this specific request, it fdqn is looked up only for "logging" to sys.stderr. Either removing the fqdn call or just caching per connection it as the patch does is both fine. I doubt if someone is relying this logging anywhere in the code. This is use

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Actually, DNS resolution should be disabled by default, as in most HTTP servers probably. -- nosy: +pitrou stage: -> unit test needed ___ Python tracker _

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-25 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: > Doesn't that only cache the first remote client it encounters, though? Maybe > a dictionary of caches? A BaseHTTPRequestHandler is instantiated every time a client connects, so there should be only one client per handler, no (the cache is an attrib

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-25 Thread Charles-Francois Natali
Changes by Charles-Francois Natali : Removed file: http://bugs.python.org/file17079/base_http_server_fqdn_lag.diff ___ Python tracker ___ ___ P

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-25 Thread Santoso Wijaya
Santoso Wijaya added the comment: Doesn't that only cache the first remote client it encounters, though? Maybe a dictionary of caches? -- ___ Python tracker ___

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-25 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: The attached patch caches the result of FQDN lookup. -- keywords: +patch Added file: http://bugs.python.org/file17079/base_http_server_fqdn_lag.diff ___ Python tracker ___

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-22 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +orsenthil priority: -> normal versions: +Python 3.2 -Python 2.6 ___ Python tracker ___ ___ Pytho

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-22 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: Yes, performing a DNS resolution every time we log something is definitely sub-optimal. We should perform it only once, and cache the result. -- nosy: +neologix ___ Python tracker

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2010-04-21 Thread Santoso Wijaya
Santoso Wijaya added the comment: There is a simple workaround to bypass the hostname resolution mechanism, so that the server can respond faster. # This is a hack to patch slow socket.getfqdn calls that # BaseHTTPServer (and its subclasses) make. # See: http://bugs.python.org/issue6085 # See:

[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2009-05-22 Thread Wentao Han
New submission from Wentao Han : The invocation of socket.getfqdn to get FQDN of the host may delay for several seconds on some platforms when no appropriate host name is found. This causes lag when using SimpleXMLRPCServer and other class derived from BaseHTTPServer for every request. --