Re: Ambiguity on HTTP/3 HEADERS and QUIC STREAM FIN requirement

Hey Willy,

On Fri, Jun 17, 2022, at 14:53, Willy Tarreau wrote:
> Probably, but I'm still seeing it as a workaround. I mean, since HTTP/1.0
> we've been used to know when receiving a full headers block the entire
> list of the header fields. And it looks like with H3 the headers block
> is uncertain at the end of a HEADERS frame. 

I don't think that's right.  There are two layers at work here, but you do have a clear marker for the end of the header block.

The HEADERS frame has ended in this case, so you have a clear indication that you have all the headers.
The QUIC stream, which in this case hasn't ended, so you aren't sure if content or trailers might follow.

>    A sender which knows that no data follows the headers block SHOULD
>    signal the end of the message by setting the FIN bit along with the
>    HEADERS frame. A receiver that processes a HEADERS frame without
>    seeing a FIN bit MAY expect more data to follow regardless of the
>    HTTP method used.

This is entirely sensible advise to give, but it isn't always possible due to how different pieces of software work.  There are some rather fundamental design choices involved that can make it hard to guarantee that these two things leave at the same time.  As you say, most people can deliver on this, but not all.

> Sure but while you can often do this when you're a server, you practically
> can't when you're a gateway, because that would require to adjust the
> behavior per-URI. 

Yeah, a gateway is in a bad position here because they don't really speak for the resource and so - without extra information about resources, which could be made for all resources on a server, but probably won't be - they have to sit on their hands, buffer requests, and pay the ridiculous cost of doing that.

But if you take the fact that you have a clear signal that the headers are done, you can - even as a gateway - make some decisions.  It might not be 100% safe, but I can't see any origin servers complaining if you started processing from that point, for GET and HEAD requests at least.

Received on Friday, 17 June 2022 05:03:33 UTC