BUG/MINOR: server: decrement session idle_conns on del server

When a server is deleted, each of its idle connections are removed. This
is also performed for every private connections stored on sessions which
referenced the target server.

As mentionned above, these private connections are idle, guaranteed by
srv_check_for_deletion(). A BUG_ON() on CO_FL_SESS_IDLE is already
present to guarantee this. Thus, these connections are accounted on the
session to enforce max-session-srv-conns limit.

However, this counter is not decremented during private conns cleanup on
"del server" handler. This patch fixes this by adding a decrement for
every private connections removed via "del server".

This should be backported up to 3.0.
This commit is contained in:
Amaury Denoyelle 2025-08-19 15:41:43 +02:00
parent bce29bc7a4
commit 0be225f341

View File

@ -6434,10 +6434,11 @@ static int cli_parse_delete_server(char **args, char *payload, struct appctx *ap
/* Only idle connections should be present if srv_check_for_deletion() is true. */
BUG_ON(!(conn->flags & CO_FL_SESS_IDLE));
--((struct session *)conn->owner)->idle_conns;
LIST_DEL_INIT(&conn->sess_el);
conn->owner = NULL;
conn->flags &= ~CO_FL_SESS_IDLE;
if (sess_conns->tid != tid) {
if (conn->mux && conn->mux->takeover)
conn->mux->takeover(conn, sess_conns->tid, 1);