]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: delay maxjitter/maxdistance warning messages
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 12 Mar 2025 14:21:18 +0000 (15:21 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 13 Mar 2025 15:16:28 +0000 (16:16 +0100)
Avoid logging the new warning messages about exceeded maxjitter or
maxdistance when only a small number of samples is collected after the
source becomes reachable and the values are unstable. Log the messages
only when a replacement attempt is made.

sources.c

index 8b7e8ebbe04fe64d8e4b8cd2f623fd938f234d6f..d7c112317e0e042f84074b61bae77d660d1b1387 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -767,14 +767,14 @@ mark_source(SRC_Instance inst, SRC_Status status)
   if (!inst->reported_status[status]) {
     switch (status) {
       case SRC_BAD_DISTANCE:
-        if (inst->reachability_size < SOURCE_REACH_BITS && inst->bad < BAD_HANDLE_THRESHOLD)
+        if (inst->bad < BAD_HANDLE_THRESHOLD)
           break;
         log_selection_source(LOGS_WARN, inst,
                              "Root distance of ## exceeds maxdistance of %.3f seconds",
                              max_distance);
         break;
       case SRC_JITTERY:
-        if (inst->reachability_size < SOURCE_REACH_BITS && inst->bad < BAD_HANDLE_THRESHOLD)
+        if (inst->bad < BAD_HANDLE_THRESHOLD)
           break;
         log_selection_source(LOGS_WARN, inst,
                              "Jitter of ## exceeds maxjitter of %.3f seconds",