Issue 21032: Socket leak if HTTPConnection.getresponse() fails (original ) (raw )Created on 2014-03-23 04:05 by martin.panter , last changed 2022-04-11 14:58 by admin . This issue is now closed .
Pull Requests
URL
Status
Linked
Edit
PR 22737
fbidu,2020-10-23 19:09
Messages (7)
msg214546 - (view)
Author: Martin Panter (martin.panter) *
Date: 2014-03-23 04:05
Here is a regression test and patch to close the socket reader when a HTTP server causes getresponse() to fail, for instance if the server times out and drops the connection without sending any response. Without the patch the socket will only be closed by the garbage collector at some arbitrary point.
msg231330 - (view)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2014-11-18 17:21
Could you please submit a contributor form (https://www.python.org/psf/contrib/ ) Martin?
msg231917 - (view)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2014-12-01 09:15
What is the status of your contributor agreement Martin?
msg231922 - (view)
Author: Martin Panter (martin.panter) *
Date: 2014-12-01 09:37
Hi Serhiy, I submitted the form online on 22 Nov; just patiently waiting for it to come through now. In the last few minutes I noticed an asterisk has appeared against my name on the bug tracker, so hopefully it is all good now.
msg231923 - (view)
Author: Roundup Robot (python-dev)
Date: 2014-12-01 09:52
New changeset 561d1d0de518 by Serhiy Storchaka in branch 'default': Issue #21032 : Deprecated the use of re.LOCALE flag with str patterns or https://hg.python.org/cpython/rev/561d1d0de518
msg231930 - (view)
Author: Roundup Robot (python-dev)
Date: 2014-12-01 11:16
New changeset f88c00391dd8 by Serhiy Storchaka in branch '2.7': Issue #21032 . Fixed socket leak if HTTPConnection.getresponse() fails. https://hg.python.org/cpython/rev/f88c00391dd8 New changeset ba72da4883eb by Serhiy Storchaka in branch '3.4': Issue #21032 . Fixed socket leak if HTTPConnection.getresponse() fails. https://hg.python.org/cpython/rev/ba72da4883eb New changeset 62a058c76869 by Serhiy Storchaka in branch 'default': Issue #21032 . Fixed socket leak if HTTPConnection.getresponse() fails. https://hg.python.org/cpython/rev/62a058c76869
msg231934 - (view)
Author: Serhiy Storchaka (serhiy.storchaka) *
Date: 2014-12-01 11:24
Few notes about patches. Check patches for trailing spaces. And it would be more suitable if you provide single patch instead of a couple of patches. I have slightly changed the test, so it checks that the file is actually closed, not lost, The fix LGTM. Thank you for your contribution Martin.
History
Date
User
Action
Args
2022-04-11 14:58:00
admin
set
github: 65231
2020-10-23 19:09:49
fbidu
set
nosy: + fbidu pull_requests: + <pull%5Frequest21848>
2014-12-01 11:24:01
serhiy.storchaka
set
status: open -> closedversions: + Python 2.7messages: + resolution: fixedstage: patch review -> resolved
2014-12-01 11:16:43
python-dev
set
messages: +
2014-12-01 09:52:11
python-dev
set
nosy: + python-dev messages: +
2014-12-01 09:37:34
martin.panter
set
messages: +
2014-12-01 09:15:24
serhiy.storchaka
set
messages: +
2014-11-18 17:21:19
serhiy.storchaka
set
versions: + Python 3.5nosy: + serhiy.storchaka messages: + assignee: serhiy.storchaka stage: patch review
2014-03-23 04:06:13
martin.panter
set
files: + close.patch
2014-03-23 04:05:47
martin.panter
create