Python's requests library only supports timeout on connect and read http://docs.python-requests.org/en/master/user/advanced/#timeouts
There is no way to force a timeout when DNS lookup takes a very long time. I would like to trigger time out when it takes more than X seconds to complete GET request (including DNS, connect and read).
Note that I cannot use signal based approach since it works only in main thread.
I am looking for an elegant solution.