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

Fixes #8558 - Idle timeout occurs on HTTP/2 with InputStreamResponseL… #8585

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Sep 14, 2022

…istener.

The issue was that HttpReceiverOverHTTP2.ContentNotifier.offer() was racy, as a network thread could have offered a DATA frame, but not yet called process() -- yet an application thread could have stolen the DATA frame completed the response and started another response, causing the network thread to interact with the wrong response.

The implementation has been changed so that HttpReceiverOverHTTP2.ContentNotifier does not have a queue anymore and it demands DATA frames to the Stream only when the application demands more -- a simpler model that just forwards the demand.

Signed-off-by: Simone Bordet [email protected]

…istener.

The issue was that HttpReceiverOverHTTP2.ContentNotifier.offer() was racy,
as a network thread could have offered a DATA frame, but not yet called
process() -- yet an application thread could have stolen the DATA frame
completed the response and started another response, causing the network
thread to interact with the wrong response.

The implementation has been changed so that HttpReceiverOverHTTP2.ContentNotifier
does not have a queue anymore and it demands DATA frames to the Stream
only when the application demands more -- a simpler model that just forwards
the demand.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet requested a review from lorban September 14, 2022 21:18
lorban
lorban previously approved these changes Sep 15, 2022
Copy link
Contributor

@lorban lorban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a few suggestions, up to you to take them into account or ignore them.

Otherwise LGTM.

try
{
if (progress.incrementAndGet() % 1000 == 0)
System.err.printf("progress %d/%d%n", progress.get(), requestCount);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be removed/commented out.

}
catch (Exception e)
{
fail(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a rethrow as a RuntimeException.

…istener.

Updates after review.

Signed-off-by: Simone Bordet <[email protected]>
@sbordet sbordet merged commit dab4fe6 into jetty-10.0.x Sep 15, 2022
@sbordet sbordet deleted the jetty-10.0.x-8858-idle-timeout-http2-inputstreamresponselistener branch September 15, 2022 08:18
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.

Idle timeout occured sometimes on HTTP/2 client with InputStreamResponseListener
2 participants