Ntppool-agent changes from 4.1.0 to 4.2.0

The main change here is that I merged a postgres refactor into the main branch as I’m updating the beta site with that (and the production site soon I hope). The ntppool-agent should work with either. The list below is a Claude summary of the CHANGES file.

The current version in the production repository is 4.1.6 (since earlier today) which was primarily just a rebuild with updated Go and dependencies (from the agent perspective) and the current beta version is 4.2.0 (some features around “implausible RTTs” that a single since long deleted server exhibited a while ago).

v4.2.0

Upgrading the agent needs no other change. It works with both the old MySQL server and the new PostgreSQL server.

Client

  • Fix: The agent reports a sample with a zero or negative round trip time as an error (“implausible rtt”). Before, it treated that sample as a fast, healthy response. The best sample is the one with the lowest rtt, so a bogus zero beat good samples. Now the agent prefers the other samples for that NTP server. If every sample is bad, it reports the server as an error. On the local clock check, a reference server that fails this way counts as a failure.
  • Fix: An empty configuration response from the API is now an error. Before, it crashed the agent with a nil pointer dereference.
  • Fix: An ad-hoc NTP check from the web interface no longer changes the sample count of the agent’s regular checks.

Server

  • A zero or negative round trip time now counts against the monitored NTP server. Such a response means the server reported spending longer on the request than the whole exchange took. monitor-api scores it as an error (“implausible rtt”: step -4, no offset), drops the rtt, and logs a warning with the server and the rtt. Before, monitor-api scored the response on its offset.
  • Timeouts no longer count as a 0 ms round trip in the average that ranks monitors for an NTP server. Monitors that see timeouts rank lower than before.

v4.1.6

Server

  • Promotion from testing to active no longer blocks silently. The selector now derives the minimum sample counts for testing → active and candidate → testing promotions from interval_testing. With interval_testing above about 45 minutes, the old fixed threshold was unreachable, so no monitor could move from testing to active. The default interval_testing is now 30 minutes (was 45).
  • Fix: The scorer no longer crashes and replays the same entry forever when an NTP server has no recent monitor data, for example when every probe times out. It now skips those entries and counts them in scorer_score_errors_skipped_total. Before, the scorer never moved past that entry.
  • Fix: Result submissions no longer queue behind the scorer. The scorer used to hold row locks on servers for a whole batch. It now updates servers after the batch commits.
  • Fix: SubmitResults is back to 1 transaction per status. The single transaction that v4.1.5 added caused transaction deadlocks.

Packaging

  • Fix: The postinstall script skips systemctl calls when systemd isn’t PID 1. The check in v4.1.2 ran systemctl --version, which succeeds in any container that has systemctl installed. The script now checks for /run/systemd/system.

v4.1.5

Client

  • RPC timeouts are longer: 30s for the response header and 60s overall (was 10s and 30s). SubmitResults can now wait out database contention on the server.
  • Batch error logs carry the matching trace_id, and failed batches show up as errored spans.

v4.1.4

Client

  • Better systemd journal support, from an upgrade of go.ntppool.org/common to v0.10.2.

v4.1.3

Client

  • When stderr connects to journald, the agent sends each log record through the native journal protocol with its own priority. journalctl -p and LogLevelMax= in the unit file now filter by severity. DEBUG_INVOCATION (set by RestartMode=debug) raises stderr verbosity to debug after a failed restart.
  • On an MQTT session takeover (reason code 0x8E), the agent backs off its reconnects: 2m, then 5m, 10m and 15m. Before, it reconnected every 10s. That code means another client connected with the same client ID.
  • While another client holds the session, the agent pauses NTP checks and result submission. The backoff resets after 30 minutes of stable connection, and the agent now always logs the disconnect reason code.

v4.1.2

Client

  • New --log-level flag and MONITOR_LOG_LEVEL environment variable set the stderr log level. --debug overrides both and sets the level to DEBUG. The server controls the OTLP log level through the gRPC config, and the agent caches it in state.json.
  • The agent sets OTEL_SERVICE_NAME=ntppool-agent, so its logs appear in Loki under the correct service name.

Packaging

  • The postinstall script exits cleanly on non-systemd systems and in containers where systemctl exists but systemd isn’t PID 1. Until v4.1.6, this check wrongly passed in any container that had systemctl installed.

v4.1.1

Packaging

  • On upgrade, the postinstall script disables all legacy ntppool-monitor@* systemd units and clears their failed-unit records. The package now declares a conflict with the old package, so the replacement is clean.

v4.1.0

Packaging

  • The deb, rpm and apk packages declare that they replace the old ntppool-monitor package, so an upgrade removes it.

Hi @ask, how are non linux people supposed to find the new releases? At some stage you did enable indexing on https://builds.ntppool.dev/ntppool-agent/builds/release/ so that one can see the build directories and then find the latest build, but indexing has been turned off for a while now and trying to access the builds/release/ directory just produce an Access Denied error.

@john1 The only not mac mini or raspberry pi type server I have at home is a FreeBSD box, so you’d think I’d make this easier!

I’ll add something to the release process to fix this permanently.

@ask, while you’re at it, would it also be possible to re-enable the monitor statistics on the monitor management page (“Tests/minute” per monitor, and aggregate for all monitors, averaged over 1 hour and 24 hours), please?

Since a while, the aggregate numbers at the top of the monitor management page are missing, and the per-monitor numbers are “0.0 (1h), 0.0 (24h)”.

Thanks!

The ntppool-agent binary found inside 4.1.6 i386 deb release is still not run-able on Pentium3 which lacks SSE2… Built 4.2.0 from Github tagged release instead.

GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "i586-slackware-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./ntppool-agent...
(No debugging symbols found in ./ntppool-agent)
(gdb) run
Starting program: /usr/local/src/ntppool-agent/agent-4.1.6/usr/bin/ntppool-agent

Program received signal SIGILL, Illegal instruction.
0x080b602b in ?? ()
(gdb) x/i $eip
=> 0x80b602b:   movsd  %xmm0,0x20(%esp)
(gdb)

(MOVSD is SSE2 instruction)

I updated but got 4.1.6 for Debian, not 4.2.0.

I presume it’s not released yet?

I guess you skipped the 2nd paragraph of Ask’s message:

Didn’t read the entire topic.
As I got a notification about 4.2.0
So I expected to get it.

@john1 ntppool-agent builds is browsable now!

And monitor stats are back, thanks @ask!!

4.2.0 is released, but as @john1 pointed out, just in the test repository for now. There were a lot of changes, but few relevant for the monitoring agent so … slow and careful.

@alica I gave fixing this another try (well Claude did)… I agree that running slower on more platforms (in particular for an already ancient architecture) is better than running a tiny tiny bit faster on less platforms.

Will you try this build? If so I will release it as 4.2.1.

Yeah, looks like this build works: :+1:

root@atelier:/usr/local/src/ntppool-agent# uname -p
Intel(R) Pentium(R) III CPU - S         1400MHz
root@atelier:/usr/local/src/ntppool-agent# ./ntppool-agent version
ntppool-agent v4.2.0-70/9b7d688 (2026-09-22T05:24:51Z, go1.26.8)

@ask, thanks for 4.1.6, as my 4.1.5 was stalled, not doing anything.
After the update to 4.1.6 it started checking again.

For me this update made it work again.

And I realize just now only that also the “Monitors” menu entry in the left side pane on the management page is back as well, thanks for that as well, @ask!