]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli/wait: rename the condition "srv-unused" to "srv-removable"
authorWilly Tarreau <w@1wt.eu>
Sat, 27 Apr 2024 07:12:34 +0000 (09:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 27 Apr 2024 07:36:36 +0000 (09:36 +0200)
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.

doc/management.txt
src/cli.c

index 85f7f1364e49f6785e43439ec72a073c21114f38..63e4c28fb484cb03cd2175124238ab9553969f2e 100644 (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"
 
 
index 02cb068439f48d5ac99a46b851a05913de79ac78..c29a15ef69f06886a6ef62a70006fdc891959edf 100644 (file)
--- 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
                        "  - <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)