ntp: repeat resolving until all pool sources are resolved
When resolving of a pool name succeeds, don't remove the remaining unresolved sources, i.e. try to get all maxsources (default 4) sources, even if it takes multiple DNS requests.
This commit is contained in:
parent
8c25632321
commit
9d1c1505b9
2 changed files with 11 additions and 13 deletions
|
@ -269,16 +269,18 @@ which might change over time.
|
||||||
+
|
+
|
||||||
All options valid in the <<server,*server*>> directive can be used in this
|
All options valid in the <<server,*server*>> directive can be used in this
|
||||||
directive too. There is one option specific to the *pool* directive:
|
directive too. There is one option specific to the *pool* directive:
|
||||||
*maxsources* sets the maximum number of sources that can be used from the pool,
|
|
||||||
the default value is 4.
|
|
||||||
+
|
+
|
||||||
On start, when the pool name is resolved, *chronyd* will add up to 16 sources,
|
*maxsources* _sources_:::
|
||||||
one for each resolved address. When the number of sources from which at least
|
This option sets the desired number of sources to be used from the pool.
|
||||||
one valid reply was received reaches the number specified by the *maxsources*
|
*chronyd* will repeatedly try to resolve the name until it gets this number of
|
||||||
option, the other sources will be removed. When a pool source is unreachable,
|
sources responding to requests. The default value is 4 and the maximum value is
|
||||||
|
16.
|
||||||
|
+
|
||||||
|
::
|
||||||
|
When an NTP source is unreachable,
|
||||||
marked as a falseticker, or has a distance larger than the limit set by the
|
marked as a falseticker, or has a distance larger than the limit set by the
|
||||||
<<maxdistance,*maxdistance*>> directive, *chronyd* will try to replace the
|
<<maxdistance,*maxdistance*>> directive, *chronyd* will try to replace the
|
||||||
source with a newly resolved address from the pool.
|
source with a newly resolved address of the name.
|
||||||
+
|
+
|
||||||
An example of the *pool* directive is
|
An example of the *pool* directive is
|
||||||
+
|
+
|
||||||
|
|
|
@ -424,10 +424,6 @@ process_resolved_name(struct UnresolvedSource *us, IPAddr *ip_addrs, int n_addrs
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Remove pool sources that didn't get an address */
|
|
||||||
if (us->pool != INVALID_POOL)
|
|
||||||
remove_pool_sources(us->pool, 0, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
@ -485,9 +481,9 @@ name_resolve_handler(DNS_Status status, int n_addrs, IPAddr *ip_addrs, void *any
|
||||||
|
|
||||||
next = us->next;
|
next = us->next;
|
||||||
|
|
||||||
/* Don't repeat the resolving if it didn't (temporarily) fail, it was a
|
/* Don't repeat the resolving if it (permanently) failed, it was a
|
||||||
replacement of a real address, or all addresses are already resolved */
|
replacement of a real address, or all addresses are already resolved */
|
||||||
if (status != DNS_TryAgain || UTI_IsIPReal(&us->address.ip_addr) || is_resolved(us))
|
if (status == DNS_Failure || UTI_IsIPReal(&us->address.ip_addr) || is_resolved(us))
|
||||||
remove_unresolved_source(us);
|
remove_unresolved_source(us);
|
||||||
|
|
||||||
resolving_source = next;
|
resolving_source = next;
|
||||||
|
|
Loading…
Reference in a new issue