-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
HTTP2 requests waiting an outstanding connecting task should not be canceled when the connecting task is canceled #3199
Comments
Oh, thanks so much for the code, that helped me understand the subtlety you were getting at. It seems like the other pending slots should "take over" the connecting task if the first one is given up. Does that sound right? |
Yes, that should do it. |
Do you want to try to take that on? I imagine a unit test wouldn't be that hard to adapt from the code you included here. You could probably make use of |
Sure! To release branch 0.14.x right? What about hyper-util? Should I open a PR there as well? |
If you want to use it with 0.14, Yea. If you want to use in 1.0, something similar in util would be needed. |
…is canceled In the previous implementation the `connect_to` future was spawned to let it finish when the checkout future won the race. However, in the event of the user dropping the `ResponseFuture`, the `connect_to` future was canceled as well, and all the http2 requests waiting for the connection would error as a result. This commit prevents that by spawning the `connect_to` future invariably (once it starts) thus covering both cases. Fixes hyperium#3199
…is canceled In the previous implementation the `connect_to` future was spawned to let it finish when the checkout future won the race. However, in the event of the user dropping the `ResponseFuture`, the `connect_to` future was canceled as well, and all the http2 requests waiting for the connection would error as a result. This commit prevents that by spawning the `connect_to` future invariably (once it starts) thus covering both cases. Fixes hyperium#3199
Version
0.14.25. I guess it applies also to the pool in hyper-util, but haven't really checked.
Platform
Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000 arm64
Description
When there are a bunch of HTTP2 requests waiting for a connection from the pool and there is already a connecting task, if the connecting task is dropped before the waiters receive the new connection we drop all the waiter senders, resulting in the cancelation of the awaiting requests, arguing that the connecting attempt failed. However, this also happens if the connecting attempt is cancelled by the user (ie the
ResponseFuture
is dropped) and not technically failed.I've written this test that reproduces (what I consider) the bug:
Thoughts? I'm up to work on a solution if we agree on the assessment.
The text was updated successfully, but these errors were encountered: