New submission from Kevin Burke:

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

----------
components: Library (Lib)
messages: 231266
nosy: kevinburke
priority: normal
severity: normal
status: open
title: set a timeout for DNS lookups
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22889>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to