Skip to content

Unexpected behaviour with poll-interval configuration #1811

@lperlaki

Description

@lperlaki

Our usecase

Initial time sync at startup and then polling with big intervals, since our application is not sensitive to (milli-)second precise timestamps.

Relevant file: ntp.toml

[source-defaults]

Some values are shared between all sources in the daemon. You can configure these in the [source-defaults] section.

poll-interval-limits = { min = min, max = max } ({ min = 4, max = 10})

Specifies the limit on how often a source is queried for a new time. For most instances the defaults will be adequate. The min and max are given as the log2 of the number of seconds (i.e. two to the power of the interval). An interval of 4 equates to 32 seconds, 10 results in an interval of 1024 seconds. If specified, both min and max must be specified.

initial-poll-interval = interval (4)

Initial poll interval used on startup. The value is given as the log2 of the number of seconds (i.e. two to the power of the interval). The default value of 4 results in an interval of 32 seconds.

we tested with poll-interval-limits = { min = 2, max = 10} and initial-poll-interval = 5,
which should result in 4 second interval as min value and 32 second interval as initial value

Expected behavior

  • ntpd-rs polls the nts server with interval initial-poll-interval until the local time is updated (or confirmed)
  • ntpd-rs changes the interval to something within the poll-interval-limits
  • ntpd-rs polls with the new interval from now on

Actual behavior

  • ntpd-rs polls the nts server with interval poll-interval-limits min value for 8 times
  • ntpd-rs changes the poll interval to initial-poll-interval (ONLY if it is within the range of poll-interval-limits)
  • ntpd-rs polls with the new interval from now on

Other info

OS: FreeBSD 14.2
ntpd-rs version: 1.3.1 (since only this is available via pkg install)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions