]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mux-quic: adjust buggy proxy closing support
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 23 May 2022 06:52:58 +0000 (08:52 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 23 May 2022 09:05:52 +0000 (11:05 +0200)
commitd0c62328afe290e6009ae17e092b7df17d73c29b
tree52cae9e8ff5b71ec59de6710a5bd8d961a9eb95d
parent22535a56a785d45dd0537e36eb90921662efd1dd
BUG/MEDIUM: mux-quic: adjust buggy proxy closing support

The wake handler detects if the frontend is closed. This can happen if
the proxy has been disabled individually or even on process soft-stop.
Before this patch, in this condition QCS instances were freed before
being detached from the cs_endpoint. This clearly violates the haproxy
connection architecture and cause a BUG_ON statement crash in cs_free().

To handle this properly, cs_endpoint is notified by setting RD_SH|WR_SH
on connection flags. The cs_endpoint will thus use the detach operation
which allows the QCS instance to be freed.

This code allows the soft-stop process to complete as soon as possible.
However, the client is not notified about the connection closing. It
should be done by emitting a H3 GOAWAY + CONNECTION_CLOSE. Sadly, this
is impossible at this stage because the listener sockets are closed so
the quic-conn cannot use it to emit new frames. At this stage the client
will most probably detect connection closing on its idle timeout
expiration.

Thus, to completely support proxy closing/soft-stop, important
architecture changes are required in QUIC socket management. This is
also linked with the reload feature.
src/mux_quic.c