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.
This commit is contained in:
Amaury Denoyelle 2025-08-27 11:27:30 +02:00
parent fa1a168bf1
commit b18b5e2f74

View File

@ -6799,6 +6799,9 @@ static int _srv_update_status_adm(struct server *s, enum srv_adm_st_chg_cause ca
} }
free_trash_chunk(tmptrash); free_trash_chunk(tmptrash);
} }
/* force connection cleanup on the given server */
srv_cleanup_connections(s);
} }
else { /* server was still running */ else { /* server was still running */
s->check.health = 0; /* failure */ s->check.health = 0; /* failure */