]> git.kaiwu.me - haproxy.git/commit
MAJOR: server: implement purging of private idle connections
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 8 Aug 2025 15:13:43 +0000 (17:13 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Aug 2025 13:08:35 +0000 (15:08 +0200)
commit7a6e3c1a73a6f86e9531f9c738c982fdc86a4336
tree6b9e8240c552c0ef5fda17987081bf5590dd2644
parent17a1daca72c10d24e9e0a8199be83c6007c116d7
MAJOR: server: implement purging of private idle connections

When a server goes into maintenance, or if its IP address is changed,
idle connections attached to it are scheduled for deletion via the purge
mechanism. Connections are moved from server idle/safe list to the purge
list relative to their thread. Connections are freed on their owned
thread by the scheduled purge task.

This patch extends this procedure to also handle private idle
connections stored in sessions instead of servers. This is possible
thanks via <sess_conns> list server member. A call to the newly
defined-function session_purge_conns() is performed on each list
element. This moves private connections from their session to the purge
list alongside other server idle connections.

This change relies on the serie of previous commits which ensure that
access to private idle connections is now thread-safe, with idle_conns
lock usage and careful manipulation of private idle conns in
input/output handlers.

The main benefit of this patch is that now all idle connections
targetting a server set in maintenance are removed. Previously, private
connections would remain until their attach sessions were closed.
include/haproxy/session.h
src/server.c
src/session.c