[Twisted-web] web2: reverse dns lookup in twisted reactor thread

Div Shekhar div.shekhar at gmail.com
Tue Jul 11 14:41:16 CDT 2006


Hi,

I've been using web2 for WSGI apps for a few months, and it's been
working fine. However, I did run into one bug this week:

web2 does a reverse dns lookup of the client ip address, and in the
twisted reactor thread, no less! When the dns server is unreachable,
this delays that http request and blocks twisted as well.

I'm planning to solve this by commenting out line 490 in
twisted/web2/channel/http.py:

        host.host = _cachedGetHostByAddr(host.host)

I'd recommend that this lookup be moved to wsgi thread and/or be
turned off by default. Just wanted to check - am I missing something?

Cheers,
Div.



More information about the Twisted-web mailing list