From b18b5e2f742b717d45ed0188c35e0ad7051e6a20 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 27 Aug 2025 11:27:30 +0200 Subject: [PATCH] MINOR: server: cleanup idle conns for server in maint already stopped When a server goes into maintenance mode, its idle connections are scheduled for an immediate purge. However, this is not the case if the server is already in stopped state, for example due to a health check failure. Adjust _srv_update_status_adm() to ensure that idle connections are always scheduled for purge when going into maintenance in both cases. The main advantage of this patch is to ensure consistent behavior for server maintenance mode. Note that it will also become necessary as server deletion will be adjusted with a future patch. Idle connection closure won't be performed by "del server" handler anymore, so it's important to ensure that a full cleanup is always performed prior to executing it, else the server may not be removable during a certain delay. --- src/server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server.c b/src/server.c index d736362f7..88e85b724 100644 --- a/src/server.c +++ b/src/server.c @@ -6799,6 +6799,9 @@ static int _srv_update_status_adm(struct server *s, enum srv_adm_st_chg_cause ca } free_trash_chunk(tmptrash); } + + /* force connection cleanup on the given server */ + srv_cleanup_connections(s); } else { /* server was still running */ s->check.health = 0; /* failure */