Skip to content

Conversation

@florimondmanca
Copy link
Contributor

May close encode/httpx#1414

Tweaks our HTTP/2 connection implementation so that the underlying h2_state is properly closed before bubbling up any exceptions.

Right now it seems possible for the underlying state to leak eg if the connection gets lost unexpectedly — see: encode/httpx#1414 (comment)

@florimondmanca florimondmanca changed the title Ensure h2 connection gets closed Ensure h2 connection gets closed in case of exception Dec 12, 2020
@frankwalter1301
Copy link

frankwalter1301 commented Nov 13, 2021

Doesn't work with the new version of httpcore. 'AsyncHTTP2Connection' object has no attribute 'h2_state' By changing h2_state to _h2_state in respect to the new naming of the new releases I get another error: Invalid input ConnectionInputs.SEND_HEADERS in state ConnectionState.CLOSED

@lovelydinosaur
Copy link
Contributor

@frankwalter1301 Could you give some more background about why you're bumping into this?

@frankwalter1301
Copy link

frankwalter1301 commented Nov 16, 2021 via email

@lovelydinosaur
Copy link
Contributor

Believe that #440 is what we need to close encode/httpx#1414, but yes! this is a good and sensible bit of defensive programming, and we should have it in.

@lovelydinosaur lovelydinosaur merged commit de62932 into master Nov 18, 2021
@lovelydinosaur lovelydinosaur deleted the fm/http2-close-conn branch November 18, 2021 15:32
@lovelydinosaur lovelydinosaur mentioned this pull request Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Max outbound streams is 100, 100 open

4 participants