]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Improve some comments
authorMartin Schwenke <mschwenke@ddn.com>
Wed, 1 Mar 2023 01:14:04 +0000 (12:14 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 9 Jul 2026 16:02:43 +0000 (16:02 +0000)
The word "passing" is ambiguous, since it could refer to whether a
value is passed to the function.  "exceeding" is wrong, because the
counter is equal.  Instead, use "reaching".

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events/legacy/05.system.script
ctdb/config/functions

index 66f9f4ffeb5e8349b06d5d033075c237b953d59d..d78c2cb37ec6fb9ea3dcfce0fbc1a71d449cb2a7 100755 (executable)
@@ -55,10 +55,11 @@ check_thresholds()
                                "$_thing" \
                                "$_usage" \
                                "$_unhealthy_threshold"
-                       # Only run unhealthy callout if passing the
-                       # unhealthy threshold.  That is, if the
+                       # Only run unhealthy callout when reaching
+                       # the unhealthy threshold.  That is, if the
                        # previous usage was below the threshold.
                        if [ "$_prev" -lt "$_unhealthy_threshold" ]; then
+                               # eval of "" is a no-op
                                eval "$_unhealthy_callout"
                        fi
                        echo "$_usage" >"$_cache"
index c0035815c7370fa0a6b633377459ff6f0b0b375a..e6b1c848e2338886cfe1505d8f96243299311023 100755 (executable)
@@ -1020,7 +1020,7 @@ failcount_incr()
                                "$_thing" \
                                "$_failcount" \
                                "$_unhealthy_threshold"
-                       # Only print output when exceeding the
+                       # Only print output when reaching the
                        # unhealthy threshold
                        if [ "$_failcount" -eq "$_unhealthy_threshold" ] &&
                                [ -n "$_output" ]; then
@@ -1041,7 +1041,7 @@ failcount_incr()
                "$_failcount" \
                "$_warn_threshold"
        if [ "$_failcount" -eq "$_warn_threshold" ] && [ -n "$_output" ]; then
-               # Only print output when exceeding the warning threshold
+               # Only print output when reaching the warning threshold
                echo "$_output"
        fi
 }