Skip to content

Commit b18b5e2

Browse files
committed
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.
1 parent fa1a168 commit b18b5e2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/server.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6799,6 +6799,9 @@ static int _srv_update_status_adm(struct server *s, enum srv_adm_st_chg_cause ca
67996799
}
68006800
free_trash_chunk(tmptrash);
68016801
}
6802+
6803+
/* force connection cleanup on the given server */
6804+
srv_cleanup_connections(s);
68026805
}
68036806
else { /* server was still running */
68046807
s->check.health = 0; /* failure */

0 commit comments

Comments
 (0)