{"action":"created","issue":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/3099","repository_url":"https://api.github.com/repos/kennethreitz/requests","labels_url":"https://api.github.com/repos/kennethreitz/requests/issues/3099/labels{/name}","comments_url":"https://api.github.com/repos/kennethreitz/requests/issues/3099/comments","events_url":"https://api.github.com/repos/kennethreitz/requests/issues/3099/events","html_url":"https://github.com/kennethreitz/requests/issues/3099","id":148779712,"number":3099,"title":"overall timeout","user":{"login":"emgerner-msft","id":5225146,"avatar_url":"https://avatars.githubusercontent.com/u/5225146?v=3","gravatar_id":"","url":"https://api.github.com/users/emgerner-msft","html_url":"https://github.com/emgerner-msft","followers_url":"https://api.github.com/users/emgerner-msft/followers","following_url":"https://api.github.com/users/emgerner-msft/following{/other_user}","gists_url":"https://api.github.com/users/emgerner-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/emgerner-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emgerner-msft/subscriptions","organizations_url":"https://api.github.com/users/emgerner-msft/orgs","repos_url":"https://api.github.com/users/emgerner-msft/repos","events_url":"https://api.github.com/users/emgerner-msft/events{/privacy}","received_events_url":"https://api.github.com/users/emgerner-msft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kennethreitz/requests/labels/Propose%20Close","name":"Propose Close","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-04-15T22:00:39Z","updated_at":"2016-04-27T20:36:39Z","closed_at":"2016-04-26T17:09:54Z","body":"We already make great use of the timeout parameter which allows setting per TCP transaction timeouts. This is very helpful! However, we also need to support an overall timeout across the connection. Reading the [docs on timeouts](http://docs.python-requests.org/en/master/user/quickstart/#timeouts) I see this isn't currently supported, and searching through the issues at least a bit back I didn't see another request for this feature -- excuse me if there is.\r\n\r\nI realize we can set timers in our library to accomplish this, but I'm concerned about the additional overhead (one per thread, and we may have many) as well as any adverse effects to connection pooling if we end up needing to abort a request. Is there a good way to abort a request in the first place? I didn't see anything obvious in the docs.\r\n\r\nSo: Long term, it would be great if we could add overall timeout to the requests library. Short term, is there a recommended way of implementing this on my end?"},"comment":{"url":"https://api.github.com/repos/kennethreitz/requests/issues/comments/215220089","html_url":"https://github.com/kennethreitz/requests/issues/3099#issuecomment-215220089","issue_url":"https://api.github.com/repos/kennethreitz/requests/issues/3099","id":215220089,"user":{"login":"Lukasa","id":1382556,"avatar_url":"https://avatars.githubusercontent.com/u/1382556?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukasa","html_url":"https://github.com/Lukasa","followers_url":"https://api.github.com/users/Lukasa/followers","following_url":"https://api.github.com/users/Lukasa/following{/other_user}","gists_url":"https://api.github.com/users/Lukasa/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukasa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukasa/subscriptions","organizations_url":"https://api.github.com/users/Lukasa/orgs","repos_url":"https://api.github.com/users/Lukasa/repos","events_url":"https://api.github.com/users/Lukasa/events{/privacy}","received_events_url":"https://api.github.com/users/Lukasa/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T20:36:39Z","updated_at":"2016-04-27T20:36:39Z","body":"@emgerner-msft Assuming you're using CPython, connection shutdown will happen when the request is no longer continuing. At that point all references to the underlying connection will be lost and the socket will be closed and disposed of."}}