]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: warn about sources exceeding maxdistance or maxjitter
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 Mar 2025 09:45:20 +0000 (10:45 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 6 Mar 2025 10:44:36 +0000 (11:44 +0100)
Log a warning message if a source is rejected in the source selecting
due to exceeding the maxdistance or maxjitter limit to make it more
obvious when synchronization is failing for this reason. Delay the
message until the reachability register is full (8 updates), or a
replacement of the source is attempted.

sources.c

index bfb1c45b7c0892bf66c490d96a039f050ea66c72..2ba595b5ae67ba62f03b281f1ccc51e60afd9577 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -768,6 +768,20 @@ 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)
+          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)
+          break;
+        log_selection_source(LOGS_WARN, inst,
+                             "Jitter of ## exceeds maxjitter of %.3f seconds",
+                             max_jitter);
+        break;
       case SRC_FALSETICKER:
         log_selection_source(LOGS_WARN, inst, "Detected falseticker ##");
         break;