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

HTTP/3 server: send a reset when do_send errors out #3326

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deweerdt
Copy link
Member

The current behavior of http3/server.c::do_send() is to close the stream, there is thus no way for the client to tell that there might be an issue with the response.

The code as proposed in this commit does present the issue noted in quicwg/base-drafts#3300: a re-ordering of packets might result in a worse end user experience compared to a TCP based protocol.

The current behavior of http3/server.c::do_send() is to close the stream,
there is thus no way for the client to tell that there might be an issue
with the response.

The code as proposed in this commit does present the issue noted
in quicwg/base-drafts#3300: a re-ordering
of packets might result in a worse end user experience compared to a
TCP based protocol.
@deweerdt
Copy link
Member Author

CI failed on the h3 fuzzer, i will take a look.

@deweerdt
Copy link
Member Author

deweerdt commented Dec 19, 2023

CI failed on the h3 fuzzer, i will take a look.

My understanding is that the fuzzer doesn't take into account the possibility that there was a reset sent. Before going ahead and fixing it, @kazuho what do you think of the approach? I considered setting a flag on the stream in order to sent a delayed reset instead, but that seemed trickier to test and understand, so that made me think that the approach above is more sensible.

Copy link
Member

@kazuho kazuho left a comment

Choose a reason for hiding this comment

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

@deweerdt I like the direction of the PR.

In the long run, we have the hope to rely on Reliable Stream Resets to handle the problem; it would likely be implemented by web browsers as it is a dependency of WebTransport.

For clients that do not implement that QUIC extension, resetting would be fine.

/* TODO consider how to forward error, pending resolution of https://github.com/quicwg/base-drafts/issues/3300 */
/* send a reset once the data stream, TODO delay reset: https://github.com/quicwg/base-drafts/issues/3300 */
quicly_reset_stream(stream->quic, QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0));
break;
Copy link
Member

Choose a reason for hiding this comment

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

I do not think we want to continue running to the end of the function to call finalize_do_send, as the function assumes that the there is still something to be sent from the stream.

The correct way of error-closing a stream is to call shutdown_stream and do just that.

@kazuho
Copy link
Member

kazuho commented Feb 6, 2024

One downside that I noticed with the proposed approach is that there is no guarantee that even the HTTP headers would be received by the client.

Depending on if the bytes have been emitted onto the wire or depending on when the client receives the HTTP headers or the reset, there is chance that the HTTP client just sees the reset.

I still like this change but it's worth noting that there is such a risk.

@deweerdt
Copy link
Member Author

deweerdt commented Feb 7, 2024

One downside that I noticed with the proposed approach is that there is no guarantee that even the HTTP headers would be received by the client.

Depending on if the bytes have been emitted onto the wire or depending on when the client receives the HTTP headers or the reset, there is chance that the HTTP client just sees the reset.

I still like this change but it's worth noting that there is such a risk.

I agree, that's what i tried to convey via:

The code as proposed in this commit does present the issue noted in quicwg/base-drafts#3300: a re-ordering of packets might result in a worse end user experience compared to a TCP based protocol

We could go down the path of waiting for the stream to be acked before emitting the RST but that seemed to be a large change.

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.

None yet

2 participants