Skip to content

fix(client): fail parked h2 request with connection error on close - #4275

Open
bunnysayzz wants to merge 1 commit into
hyperium:masterfrom
bunnysayzz:fix/h2-parked-dispatch-gone-4269
Open

bunnysayzz wants to merge 1 commit into
hyperium:masterfrom
bunnysayzz:fix/h2-parked-dispatch-gone-4269

Conversation

@bunnysayzz

Copy link
Copy Markdown

When the h2 connection goes away while a request is waiting for a stream to open, the parked callback was never failed. It fell through to Callback::drop, so the caller saw a DispatchGone user error instead of the connection error.

Fail the parked callback in the poll_ready error branch instead: canceled on a clean GOAWAY, the h2 reason otherwise. The original error is still returned from the task.

Adds a regression test with a server that allows one concurrent stream and closes while the second request is parked. The test fails before this change with User(DispatchGone) and passes after.

Fixes #4269

When the h2 connection drops while a request is still waiting for a
stream slot, the parked callback was left to drop, and the caller got
a misleading DispatchGone user error. Fail it with the connection
error instead: canceled on a clean GOAWAY, the h2 reason otherwise.

Adds a regression test with a server that only allows one concurrent
stream and closes while the second request is parked.

Fixes hyperium#4269

This branch has not been deployed

No deployments
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.

h2 client: request pending stream open is dropped with DispatchGone when the connection closes

1 participant