BUG/MINOR: quic: Wrong ack ranges handling when reaching the limit.
authorFrederic Lecaille <flecaille@haproxy.com>
Mon, 5 Feb 2024 13:07:51 +0000 (14:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Feb 2024 10:42:04 +0000 (11:42 +0100)
commit228d3628c2f3f4ff45c899f7d1acb89337b9b405
treeab76ed23a32b8e76dedb88e5254b95040efd4e3b
parent3859e570620957d1d71a0ab8c7ad90d56f453d70
BUG/MINOR: quic: Wrong ack ranges handling when reaching the limit.

Acknowledgements ranges are used to build ACK frames. To avoid allocating too
much such objects, a limit was set to 32(QUIC_MAX_ACK_RANGES) by this commit:

MINOR: quic: Do not allocate too much ack ranges

But there is an inversion when removing the oldest range from its tree.
eb64_first() must be used in place of eb64_last(). Note that this patch
only does this modification in addition to rename <last> variable to <first>.

This bug leads such a h2load command to block when a request ends up not
being acknowledged by haproxy even if correctly served:

/opt/nghttp2/build/bin/h2load --alpn-list h3 -t 1 -c 1 -m 1 -n 100 \
https://127.0.0.1/?s=5m

There is a remaining question to be answered. In such a case, haproxy refuses to
reopen the stream, this is a good thing but should not haproxy ackownledge the
request (because correctly parsed again).

Note that to be easily reproduced, this setting had to be applied to the client
network interface:

    tc qdisc add dev eth1 root netem delay 100ms 1s loss random

Must be backported as far as 2.6.

(cherry picked from commit 0ce61d2f6ddc0232226d135fdfd28b7ad3dfcc0f)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/quic_ack.c