From: Martin Schwenke Date: Wed, 1 Mar 2023 01:14:04 +0000 (+1100) Subject: ctdb-scripts: Improve some comments X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f976a12c5cd4fcf84dc9e29a90eef759b3ce66d;p=thirdparty%2Fsamba.git ctdb-scripts: Improve some comments 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 Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/events/legacy/05.system.script b/ctdb/config/events/legacy/05.system.script index 66f9f4ffeb5..d78c2cb37ec 100755 --- a/ctdb/config/events/legacy/05.system.script +++ b/ctdb/config/events/legacy/05.system.script @@ -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" diff --git a/ctdb/config/functions b/ctdb/config/functions index c0035815c73..e6b1c848e23 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -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 }