mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 16:05:07 -05:00
sources: select only when reference can be updated
Before selecting the new synchronization source wait until the reference can be updated, i.e. the source has new samples.
This commit is contained in:
@@ -875,7 +875,13 @@ SRC_SelectSource(SRC_Instance updated_inst)
|
|||||||
sources[selected_source_index]->status != SRC_SELECTABLE ||
|
sources[selected_source_index]->status != SRC_SELECTABLE ||
|
||||||
(max_score_index != selected_source_index && max_score > SCORE_LIMIT)) {
|
(max_score_index != selected_source_index && max_score > SCORE_LIMIT)) {
|
||||||
|
|
||||||
/* We have to elect a new synchronisation source */
|
/* Before selecting the new synchronisation source wait until the reference
|
||||||
|
can be updated */
|
||||||
|
if (sources[max_score_index]->updates == 0) {
|
||||||
|
selected_source_index = INVALID_SOURCE;
|
||||||
|
DEBUG_LOG(LOGF_Sources, "best source has no updates");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
selected_source_index = max_score_index;
|
selected_source_index = max_score_index;
|
||||||
log_selection_message("Selected source %s",
|
log_selection_message("Selected source %s",
|
||||||
|
|||||||
Reference in New Issue
Block a user