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.
This commit is contained in:
Willy Tarreau 2024-04-27 09:12:34 +02:00
parent 1db3a390bb
commit b957e741b0
2 changed files with 10 additions and 10 deletions

View File

@ -4032,13 +4032,13 @@ wait { -h | <delay> } [<condition> [<args>...]]
specified condition to be satisfied, to unrecoverably fail, or to remain
unsatisfied for the whole <delay> duration. The supported conditions are:
- srv-unused <proxy>/<server> : 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 <proxy>/<server> : 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 | <delay> } [<condition> [<args>...]]
$ 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"

View File

@ -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
" - <condition> indicates what to wait for, no longer than the specified\n"
" duration. Supported conditions are:\n"
" - <none> : by default, just sleep for the specified duration.\n"
" - srv-unused <px>/<sv> : wait for this server to become unused.\n"
" - srv-removable <px>/<sv> : wait for this server to become removable.\n"
"";
if (strcmp(args[2], "-h") == 0)