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

Simplify Expect: 100-Continue handling #10956

Closed
gregw opened this issue Nov 30, 2023 · 4 comments · Fixed by #10957
Closed

Simplify Expect: 100-Continue handling #10956

gregw opened this issue Nov 30, 2023 · 4 comments · Fixed by #10957
Labels
Bug For general bugs on Jetty side

Comments

@gregw
Copy link
Contributor

gregw commented Nov 30, 2023

Jetty version(s)
12

Description

There is duplicate handling for Expect: 100-Continue in jetty-12.
Also reports of hanging from #10513, so more testing is needed

@gregw gregw added the Bug For general bugs on Jetty side label Nov 30, 2023
gregw added a commit that referenced this issue Nov 30, 2023
Removed duplicate handling from servlet. Now only handled in core on first demand.
Added additional tests.
@gregw gregw linked a pull request Nov 30, 2023 that will close this issue
@gregw
Copy link
Contributor Author

gregw commented Dec 1, 2023

@sbordet I asked the ietf http working group and was referred to RFC9113 8.1, which says:

A server can send a complete response prior to the client sending an entire request if the response does not depend on any portion of the request that has not been sent and received. When this is true, a server MAY request that the client abort transmission of a request without error by sending a RST_STREAM with an error code of NO_ERROR after sending a complete response (i.e., a frame with the END_STREAM flag set). Clients MUST NOT discard responses as a result of receiving such a RST_STREAM, though clients can always discard responses at their discretion for other reasons.

So if the server sends a response (or commits the headers) before commencing reading of the request (and hence causing a 100 to be sent), then once the response is complete, we need to terminate the stream with a reset(NO_ERROR), to ensure the client does not hang waiting to send the request body. @lorban Apparently h3 is similar but a little different: https://datatracker.ietf.org/doc/html/rfc9114#section-4.1

It is plausible that this is the cause of the hangs in #10513, but I don't see how this was working in jetty-10? Perhaps we have just changed it enough to trigger this on a timing basis? or perhaps it is something else.

@gregw
Copy link
Contributor Author

gregw commented Dec 1, 2023

@sbordet I'm thinking that we should do a reset(NO_ERROR) for H2 consumeAll?

@sbordet
Copy link
Contributor

sbordet commented Dec 4, 2023

@gregw I agree on the reset after consumeAvailable().

sbordet added a commit that referenced this issue Dec 12, 2023
Removed duplicate handling from servlet. Now only handled in core in HttpChannelState and protected it from concurrent writes.
Added additional tests.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Co-authored-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet
Copy link
Contributor

sbordet commented Dec 12, 2023

Fixed by #10957.

@sbordet sbordet closed this as completed Dec 12, 2023
@sbordet sbordet moved this to ✅ Done in Jetty 12.0.5 - FROZEN Dec 12, 2023
@joakime joakime changed the title Jetty-12 100 Continue handling Simplify Expect: 100-Continue handling Dec 19, 2023
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
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants