Skip to content
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

H3: Fix racy read from stream-less channel #9761

Merged
merged 3 commits into from May 15, 2023

Conversation

lorban
Copy link
Contributor

@lorban lorban commented May 11, 2023

There is a race condition in the client when it is setting the stream, which happens after a new request is created and its headers are sent onto the network. If the network and the server happen to be fast enough, the response could arrive at the client before the channel's stream has been set, making HttpReceiverOverHTTP3 see a null stream.

The solution is to set the stream field before any data is sent onto the network, like HTTP/2 is doing.

Fixes #9655 once merged to 12.

…low setting the channel's stream before sending any data to the network

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban lorban added the Bug For general bugs on Jetty side label May 11, 2023
@lorban lorban requested a review from sbordet May 11, 2023 14:03
@lorban lorban self-assigned this May 11, 2023
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban lorban requested a review from sbordet May 11, 2023 16:51
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
@lorban lorban merged commit 7ac49cd into jetty-10.0.x May 15, 2023
4 checks passed
@lorban lorban deleted the fix/jetty-10-9655-racy-read-streamless-channel branch May 15, 2023 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test in jetty-12 org.eclipse.jetty.test.client.transport.HttpClientLoadTest#testIterative
2 participants