Skip to content
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

Fix patching of is_connection_dropped from urllib3 (issue #468) #605

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

peterisr
Copy link

Fix patching of is_connection_dropped from urllib3

With old patching method, urllib3 never detected TCP connections that
were closed by the server side. For example, persistent HTTP connection
that were closed by the server (e.g., due to timeout) were not
recognized as closed. Any following requests that attempted to reuse
the same, closed connection caused the following failure:

urllib3.exceptions.ProtocolError: ('Connection aborted.',
   RemoteDisconnected('Remote end closed connection without response'
))

Fixes: #468

With old patching method, urllib3 never detected TCP connections that
were closed by the server side. For example, persistent HTTP connection
that were closed by the server (e.g., due to timeout) were not
recognized as closed. Any following requests that attempted to reuse
the same, closed connection caused the following failure:

    urllib3.exceptions.ProtocolError: ('Connection aborted.',
       RemoteDisconnected('Remote end closed connection without response'
    ))

Fixes: kevin1024#468
@corps
Copy link

corps commented Feb 10, 2022

👍
I ran into this issue as well using vcr with 1.1 http connections, this PR helped me work a fix into my code. Would love to see this hit master so I can remove my patch.

@kevin1024 kevin1024 force-pushed the master branch 3 times, most recently from df3997c to 34d5384 Compare June 26, 2023 17:54
@larstiq
Copy link

larstiq commented Jul 25, 2023

We also carry this as local patch, would be nice to see the issue fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fails to re-establish a connection after keep-alive timout
3 participants