quiche icon indicating copy to clipboard operation
quiche copied to clipboard

quiche seems unable to send requests with long urls

Open icing opened this issue 4 months ago • 1 comments

I added tests in curl using GET on long urls, running all HTTP versions and backends. The tests add n * 'x' as query string to a url with n in [1k, 16k, 32k, 54k]. (see https://github.com/curl/curl/pull/18129).

All QUIC backends except quiche work, giving the server 4xx response for the URL being too long. quiche is unable to start the stream. This happens in curl_quiche.c:1025:

  stream3_id = quiche_h3_send_request(ctx->h3c, ctx->qconn, nva, nheader,
                                      stream->send_closed);
  if(stream3_id < 0) {
    if(QUICHE_H3_ERR_STREAM_BLOCKED == stream3_id) {
      /* quiche seems to report this error if the connection window is
       * exhausted. Which happens frequently and intermittent. */
      CURL_TRC_CF(data, cf, "[%"FMT_PRIu64"] blocked", stream->id);
      stream->quic_flow_blocked = TRUE;
      result = CURLE_AGAIN;
      goto out;
    }
    ...

So, we are getting QUICHE_H3_ERR_STREAM_BLOCKED and interpret this as a temporary failure, as the description say "retry later". Are we wrong or is there an error code missing for a permanent failure here?

Note: this happens not only the first request of a connection, but also when sending a successful other request with response first.

Please advise.

Version used: quiche v0.24.4

icing avatar Aug 01 '25 10:08 icing

I think this is a different manifestation of your prior https://github.com/cloudflare/quiche/issues/1573 issue. Basically, the stream write is probably blocked on send capacity arising from cwnd, because we write HEADERS atomically (rather than stream them out). That's something we want to change but has sadly not been a priority to get to yet.

Early in a connection, your cwnd will be small and not have a chance to grow. As a client that only sends "small" requests the growth might even be very slow.

As a workaround, you can play with the newish set_send_capacity_factor() https://docs.quic.tech/quiche/struct.Config.html#method.set_send_capacity_factor. This changes quiche internal to allow you to buffer more into it

As another workaround, you can also consider fiddling with the initial cwnd size if you enjoy footguns. See https://docs.quic.tech/quiche/struct.Config.html#method.set_initial_congestion_window_packets

LPardue avatar Aug 01 '25 13:08 LPardue