]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cli/wait: add a condition to wait on a server to become unused
authorWilly Tarreau <w@1wt.eu>
Fri, 9 Feb 2024 19:35:52 +0000 (20:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Feb 2024 19:38:08 +0000 (20:38 +0100)
commit613e959c7bf65cf43a9c3cd4abdb1c0593b0beb8
treed83fc1003018f1e2ec9a6b802b99d0be8fd23da1
parent66989ff4263a61948b2c240ec952b524e6f5890a
MINOR: cli/wait: add a condition to wait on a server to become unused

The "wait" command now supports a condition, "srv-unused", which waits
for the designated server to become totally unused, indicating that it
is removable. Upon each wakeup it calls srv_check_for_deletion() to
verify if conditions are met, if not if it's recoverable, or if it's
not recoverable, and proceeds according to this, never waiting for a
final decision longer than the configured delay.

The purpose is to make it possible to remove servers from the CLI after
waiting for their sessions to be terminated:

  $ socat -t5 /path/to/socket - <<< "
        disable server px/srv1
        shutdown sessions server px/srv1
        wait 2s srv-unused px/srv1
        del server px/srv1"

Or even wait for connections to terminate themselves:

  $ socat -t70 /path/to/socket - <<< "
        disable server px/srv1
        wait 1m srv-unused px/srv1
        del server px/srv1"
doc/management.txt
include/haproxy/cli-t.h
src/cli.c