This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kevinburke
Recipients kevinburke
Date 2014-11-17.05:38:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1416202700.62.0.764636248133.issue22889@psf.upfronthosting.co.za>
In-reply-to
Content
It would be nice to be able to set a timeout for DNS lookups in the event of a DNS server failure.

1. Set your DNS to something like 123.123.123.123 or any other host that is not listening for DNS queries on port 53.

2. Run requests.get('http://jsonip.com', timeout=3), or similar using urllib/http.client/httplib

3. Observe that the wall clock time is 2 minutes or higher.

It's known that a timeout value does not correspond to wall clock time, but this can be an unexpected cause of latency in http client requests, and is completely uncontrollable from client code (unless the user resolves DNS themselves). 

For a comparison, Go provides this functionality, see for example https://code.google.com/p/go/source/browse/src/pkg/net/lookup.go?name=release#55
History
Date User Action Args
2014-11-17 05:38:20kevinburkesetrecipients: + kevinburke
2014-11-17 05:38:20kevinburkesetmessageid: <1416202700.62.0.764636248133.issue22889@psf.upfronthosting.co.za>
2014-11-17 05:38:20kevinburkelinkissue22889 messages
2014-11-17 05:38:19kevinburkecreate