]> git.kaiwu.me - haproxy.git/commit
MEDIUM: server: implement "purge server" CLI
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 17 Sep 2026 13:48:37 +0000 (15:48 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 14 Oct 2026 09:33:40 +0000 (11:33 +0200)
commit410719abdc07650a0fc5692a457cf998754715b9
tree848ffdbbfb08fb01d805cda6998efa43c86fd1d7
parent120834d7059671bbc3c1899d016e3f1cc713839b
MEDIUM: server: implement "purge server" CLI

Define and implement a new CLI command "purge server". This is similar
to "del server", except that deletion is performed in background if it
cannot be completed due to a transient state.

To schedule background deletion, server instance is flagged with
SRV_F_TO_PURGE and inserted into parent proxy <servers_purge> list.
Finally, proxy purge task is scheduled. This will periodically call
srv_check_for_deletion() : on success the server instance is finally
freed (unless its refcount is non null, in which case server free should
occur soon after).

A programmed background server deletion can be cancelled via
srv_cancel_purge() : this simply remove SRV_F_TO_PURGE. This action is
performed when the server state is changed (even to remain in
maintenance).

After purge cancellation, the server will be removed from the parent
proxy list via the task handler. This is not performed directly when
removing the server flag as this may simplify future evolutions, in
particular if thread isolation is reduced and proxy lock becomes
required to manipulate purge list.
doc/management.txt
include/haproxy/server-t.h
include/haproxy/server.h
src/proxy.c
src/server.c