]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: server/mux-h2: implement idle-ping on backend side
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 8 Apr 2025 09:09:06 +0000 (11:09 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 17 Apr 2025 12:49:36 +0000 (14:49 +0200)
commita78a04cfae89505f960315d40080fde597b1d685
tree237ce4a5a190e71461c3ab880eb97f8547b990a6
parent4dcfe098a63449f3e199373b38dd88462e92fc2c
MEDIUM: server/mux-h2: implement idle-ping on backend side

This commit implements support for idle-ping on the backend side. First,
a new server keyword "idle-ping" is defined in configuration parsing. It
is used to set the corresponding new server member.

The second part of this commit implements idle-ping support on H2 MUX. A
new inlined function conn_idle_ping() is defined to access connection
idle-ping value. Two new connection flags are defined H2_CF_IDL_PING and
H2_CF_IDL_PING_SENT. The first one is set for idle connections via
h2c_update_timeout().

On h2_timeout_task() handler, if first flag is set, instead of releasing
the connection as before, the second flag is set and tasklet is
scheduled. As both flags are now set, h2_process_mux() will proceed to
PING emission. The timer has also been rearmed to the idle-ping value.
If a PING ACK is received before next timeout, connection timer is
refreshed. Else, the connection is released, as with timer expiration.

Also of importance, special care is needed when a backend connection is
going to idle. In this case, idle-ping timer must be rearmed. Thus a new
invokation of h2c_update_timeout() is performed on h2_detach().
doc/configuration.txt
include/haproxy/connection.h
include/haproxy/mux_h2-t.h
include/haproxy/server-t.h
src/mux_h2.c
src/server.c