From: Willy Tarreau Date: Sat, 27 Apr 2024 07:12:34 +0000 (+0200) Subject: MINOR: cli/wait: rename the condition "srv-unused" to "srv-removable" X-Git-Tag: v3.0-dev9~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b957e741b01cf187b2ff74c8508e5bcc3891b171;p=thirdparty%2Fhaproxy.git MINOR: cli/wait: rename the condition "srv-unused" to "srv-removable" As previously discussed, "srv-unused" is sufficiently ambiguous to cause some trouble over the long term. Better use "srv-removable" to indicate that the server is removable, and if the conditions to delete a server change over time, the wait condition will be adjusted without renaming it. --- diff --git a/doc/management.txt b/doc/management.txt index 85f7f1364e..63e4c28fb4 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -4032,13 +4032,13 @@ wait { -h | } [ [...]] specified condition to be satisfied, to unrecoverably fail, or to remain unsatisfied for the whole duration. The supported conditions are: - - srv-unused / : this will wait for the specified server to be - removable, i.e. be in maintenance and no longer have any connection on it. - Some conditions will never be accepted (e.g. not in maintenance) and will - cause the report of a specific error message indicating what condition is - not met. The server might even have been removed in parallel and no longer - exit. If everything is OK before the delay, a success is returned and the - operation is terminated. + - srv-removable / : this will wait for the specified server to + be removable, i.e. be in maintenance and no longer have any connection on + it. Some conditions will never be accepted (e.g. not in maintenance) and + will cause the report of a specific error message indicating what condition + is not met. The server might even have been removed in parallel and no + longer exit. If everything is OK before the delay, a success is returned + and the operation is terminated. The default unit for the delay is milliseconds, though other units are accepted if suffixed with the usual timer units (us, ms, s, m, h, d). When @@ -4051,7 +4051,7 @@ wait { -h | } [ [...]] $ socat -t5 /path/to/socket - <<< " disable server px/srv1 shutdown sessions server px/srv1 - wait 2s srv-unused px/srv1 + wait 2s srv-removable px/srv1 del server px/srv1" diff --git a/src/cli.c b/src/cli.c index 02cb068439..c29a15ef69 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2045,7 +2045,7 @@ static int cli_parse_wait(char **args, char *payload, struct appctx *appctx, voi return cli_err(appctx, "Invalid duration.\n"); } - if (strcmp(args[2], "srv-unused") == 0) { + if (strcmp(args[2], "srv-removable") == 0) { struct ist be_name, sv_name; if (!*args[3]) @@ -2077,7 +2077,7 @@ static int cli_parse_wait(char **args, char *payload, struct appctx *appctx, voi " - indicates what to wait for, no longer than the specified\n" " duration. Supported conditions are:\n" " - : by default, just sleep for the specified duration.\n" - " - srv-unused / : wait for this server to become unused.\n" + " - srv-removable / : wait for this server to become removable.\n" ""; if (strcmp(args[2], "-h") == 0)