]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
ntp: avoid unnecessary restart of resolving round on refresh
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 14 Mar 2024 14:37:15 +0000 (15:37 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 14 Mar 2024 15:39:41 +0000 (16:39 +0100)
Don't call NSR_ResolveSources() when a resolving round is already
started. This cuts the number of calls of the system resolver made due
to the refresh command to half.

ntp_sources.c

index 1257f5775e4a03622b462edfed95fb06a968900a..64d9a8b46323c138639ca855522a29255142ead7 100644 (file)
@@ -1056,7 +1056,10 @@ resolve_source_replacement(SourceRecord *record, int refreshment)
   us->address = *record->remote_addr;
 
   append_unresolved_source(us);
-  NSR_ResolveSources();
+
+  /* Don't restart resolving round if already running */
+  if (!resolving_source)
+    NSR_ResolveSources();
 }
 
 /* ================================================== */