New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket leak if HTTPConnection.getresponse() fails #65231
Comments
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. |
Could you please submit a contributor form (https://www.python.org/psf/contrib/) Martin? |
What is the status of your contributor agreement Martin? |
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. |
New changeset 561d1d0de518 by Serhiy Storchaka in branch 'default': |
New changeset f88c00391dd8 by Serhiy Storchaka in branch '2.7': New changeset ba72da4883eb by Serhiy Storchaka in branch '3.4': New changeset 62a058c76869 by Serhiy Storchaka in branch 'default': |
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. |
assert
from http/client.py #22737Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: