]> git.ipfire.org Git - thirdparty/chrony.git/commit
refclock: stop requiring 4 samples in median filter
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 Nov 2024 15:03:40 +0000 (16:03 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 Nov 2024 15:03:40 +0000 (16:03 +0100)
commit12237bf28393da84f3ab00569e741a271f50dea5
tree3546c6070247797be4ccafc6a11141bb4d6327ae
parentb9b338a8df23927d8104f41ecb21baa3558de0cd
refclock: stop requiring 4 samples in median filter

Reduce the minimum number of samples required by the filter from
min(4, length) to 1.

This makes the filtering less confusing. The sample lifetime is limited
to one poll and the default filtering of the SOCK refclock (where the
maximum number of samples per poll is unknown) is identical to the other
refclocks.

A concern with potential variability in number of samples per poll below
4 is switching between different calculations of dispersion in
combine_selected_samples() in samplefilt.c.

The 106-refclock test shows how the order of refclocks in the config can
impact the first filtered sample and selection. If the PPS refclock
follows SHM, a single low-quality PPS sample is accepted in the same
poll where SHM is selected and the initial clock correction started,
which causes larger skew later and delays the first selection of the PPS
refclock.
doc/chrony.conf.adoc
refclock.c
test/simulation/106-refclock