]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: ensure connection cleanup on server addr changes
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 11 Dec 2023 08:15:11 +0000 (09:15 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Dec 2023 13:22:26 +0000 (14:22 +0100)
Previously, in srv_update_addr_port(), we forced connection cleanup on
server changes.
This was done in 6318d33ce ("BUG/MEDIUM: connections: force connections
cleanup on server changes").

However, there is no reason we shouldn't have done the same in
srv_update_addr() function, because the end goal is the same: perform
runtime changes on server's address.

The purge_conn hint propagated through the INETADDR server event was
simply there to keep the original behavior (only purge the connection
for events originating from srv_update_addr_port()), but to ensure the
address change is handled the same way for both code paths, we simply
ignore this hint.

src/server.c

index 4d204d4f68b7047358956594aed16a66cb2ef776..6d175f7da5841d4da6f8aa5d955321b21ad169d0 100644 (file)
@@ -306,9 +306,8 @@ static struct task *server_atomic_sync(struct task *task, void *context, unsigne
                        _srv_set_inetaddr_port(srv, &new_addr,
                                               data->safe.next.port.svc, data->safe.next.port.map);
 
-                       /* propagate the changes */
-                       if (data->safe.purge_conn) /* force connection cleanup on the given server? */
-                               srv_cleanup_connections(srv);
+                       /* propagate the changes, force connection cleanup */
+                       srv_cleanup_connections(srv);
                        srv_set_dyncookie(srv);
                        srv_set_addr_desc(srv, 1);
                }