Skip to content

Conversation

seanmonstar
Copy link
Member

This cherry-picks the fix for the HTTP/2 concurrency race condition from #3041.

There exists a race condition in ClientTask::poll() when the request
that is sent via h2::client::send_request() is pending open. A task will
be spawned to wait for send capacity on the sendstream. Because this
same stream is also stored in the pending member of
h2::client::SendRequest the next iteration of the poll() loop can call
poll_ready() and call wait_send() on the same stream passed into the
spawned task.

Fix this by always calling poll_ready() after send_request(). If this
call to poll_ready() returns Pending save the necessary context in
ClientTask and only spawn the task that will eventually resolve to the
response after poll_ready() returns Ok.
@seanmonstar seanmonstar force-pushed the cherry-http2-race-lock branch from eaf32f0 to e01a306 Compare November 7, 2022 20:28
@seanmonstar seanmonstar merged commit f202230 into master Nov 7, 2022
@seanmonstar seanmonstar deleted the cherry-http2-race-lock branch November 7, 2022 20:53
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.

3 participants