From: Willy Tarreau Date: Fri, 27 Sep 2024 17:01:38 +0000 (+0200) Subject: MINOR: server: make srv_shutdown_sessions() call pendconn_redistribute() X-Git-Tag: v3.1-dev9~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d403caf8aa59c9070f30ea16017261cab679fe2;p=thirdparty%2Fhaproxy.git MINOR: server: make srv_shutdown_sessions() call pendconn_redistribute() When shutting down server sessions, the queue was not considered, which is a problem if some element reached the queue at the moment the server was going down, because there will be no more requests to kick them out of it. Let's always make sure we scan the queue to kick these streams out of it and that they can possibly find a more suitable server. This may make a difference in the time it takes to shut down a server on the CLI when lots of servers are in the queue. It might be interesting to backport this to 3.0 but probably not much further. --- diff --git a/src/server.c b/src/server.c index c0795c0a55..58862c5a17 100644 --- a/src/server.c +++ b/src/server.c @@ -2027,6 +2027,9 @@ void srv_shutdown_streams(struct server *srv, int why) MT_LIST_FOR_EACH_ENTRY_LOCKED(stream, &srv->per_thr[thr].streams, by_srv, back) if (stream->srv_conn == srv) stream_shutdown(stream, why); + + /* also kill the possibly pending streams in the queue */ + pendconn_redistribute(srv); } /* Shutdown all connections of all backup servers of a proxy. The caller must