Message231266
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 |
|
Date |
User |
Action |
Args |
2014-11-17 05:38:20 | kevinburke | set | recipients:
+ kevinburke |
2014-11-17 05:38:20 | kevinburke | set | messageid: <1416202700.62.0.764636248133.issue22889@psf.upfronthosting.co.za> |
2014-11-17 05:38:20 | kevinburke | link | issue22889 messages |
2014-11-17 05:38:19 | kevinburke | create | |
|