Ensure HTTP/2 connections are gracefully closed on async cancellation#757
Ensure HTTP/2 connections are gracefully closed on async cancellation#757karpetrosyan wants to merge 10 commits intoencode:masterfrom
Conversation
T-256
left a comment
There was a problem hiding this comment.
could (async )with self._state_lock: move under _state_housekeeping function?
I agree, it's always used. |
|
At thanks! The failing test case is especially helpful here. Pretty sure this resolution is overcomplicated, tho. I think we actually want here is?...
httpcore/httpcore/_async/http2.py Lines 106 to 113 in 21e47a7 ...so that it instead covers all of this block... httpcore/httpcore/_async/http2.py Lines 106 to 127 in 21e47a7 ie. the
httpcore/httpcore/_async/http2.py Line 129 in 21e47a7 Should also be surrounded with... try:
await self._max_streams_semaphore.acquire()
except BaseException as exc:
with AsyncShieldCancellation():
await self.aclose()
raise excWe could actually avoid (1) if we instead addressed the refactoring suggested in #738 or refactored |
|
Ugh. I need to think about this one more clearly, it's making my brain mush. |
|
I would recommend using this stupid solution for the time being and not waiting for http/2 refactoring from #770 |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closes #756
Checklist
TODO