Timeout After 301 Redirect Works Strangely

Hello friends! Having a small issue with timeouts from URLs after they throw us an HTTP 301 to a bad address. Here's an example script and what happens when I run it (hopefully the offending URL remains offending for you to test, I do not own the domain)

```
import requests
import logging

logging.basicConfig(level=logging.INFO)

url = 'https://blog.uplabs.com/feed'
req = requests.get(url, timeout=1)
```

Then I run this:

```
Thomass-MacBook-Air ~/bug $ time python test.py
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): blog.uplabs.com
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): blog.uplabs.com
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    req = requests.get(url, timeout=1)
  File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 70, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/api.py", line 56, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 617, in send
    history = [resp for resp in gen] if allow_redirects else []
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 177, in resolve_redirects
    **adapter_kwargs
  File "/usr/local/lib/python2.7/site-packages/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/requests/adapters.py", line 479, in send
    raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='blog.uplabs.com', port=3001): Max retries exceeded with url: /feed/ (Caused by ConnectTimeoutError(<requests.packages.urllib3.connection.HTTPConnection object at 0x10bcb43d0>, 'Connection to blog.uplabs.com timed out. (connect timeout=1)'))

real    0m13.104s
user    0m0.149s
sys 0m0.098s
```

My question - it does appear to be timing out, but shouldn't it be timing out much quicker? I'm giving a timeout of 1 but it appears to be taking 13 seconds for the entire script to run. It appears the original host is 301ing me to a weird port number but I think the timeout behavior should continue to apply.

If I increase timeout to 2 seconds, it takes 24 seconds:

```
real    0m24.626s
user    0m0.155s
sys 0m0.099s
```

and 3 second timeout takes 36 seconds. So it appears to be compounding?

```
real    0m37.152s
user    0m0.156s
sys 0m0.108s
```

Is there an additional setting I am missing or case I should deal with? Using requests 2.11

```
>>> import requests
>>> requests.__version__
'2.11.1'
```


I should add, when I change log level to debug, you can see the 301

```
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): blog.uplabs.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /feed HTTP/1.1" 301 178
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): blog.uplabs.com
```


So it should be noted that the timeout is _not_ a total timeout, it is instead a _per socket event_ timeout. In particular, as we're attempting to connect, it is a _per connection attempt_ timeout. The reason I phrase it this way is that, when we attempt to connect to a host, we will perform the DNS look up and then attempt to connect to _every_ host returned. Only if all of those fail will we report failure as a `ConnectionError`. I suspect that's what is happening in this case.


OK, Thanks @Lukasa - in my case, I ended up using eventlet module to wrap the entire thing in a more "global" timeout.