-
-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak NTP error reporting #2125
Conversation
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: |
Working well for me. No issues in two days of testing! EDIT: See below, spoke too soon. |
There is an reported crash on with this branch |
This crash happened somewhere in the DNS resolver thread, not code that is even remotely touched by this PR. So this may be 100% coincidence. |
Signed-off-by: DL6ER <[email protected]>
Nonetheless, I went through the resolver code line-by-line and added quite a few extra checks wherever possible. I don't think there was an issue but now everything should be even better because we are not believing in large enough buffers but actually check that before working on them. |
Signed-off-by: DL6ER <[email protected]>
Signed-off-by: DL6ER <[email protected]>
…ERROR message from showing up in the logs Signed-off-by: DL6ER <[email protected]>
…c was sufficiently far off (> 0.1 s) to postpone the start of the embedded NTP server Signed-off-by: DL6ER <[email protected]>
…pile-time constant) and enlarge retry interval to 10 minutes (or ntp.sync.interval if smaller) Signed-off-by: DL6ER <[email protected]>
Signed-off-by: Dominik <[email protected]>
This branch has been working very well for me. I haven't seen any issues since the last commits. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Conflicts have been resolved. |
This is nice, it restarts itself when the time was off too much on startup
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we prevent NTP server start at all if NTP sync is disabled?
2025-01-11 21:45:07.784 CET [196845M] INFO: NTP sync is disabled
2025-01-11 21:45:07.784 CET [196845/T196846] INFO: NTP server listening on 0.0.0.0:123 (IPv4)
2025-01-11 21:45:07.785 CET [196845/T196847] INFO: NTP server listening on :::123 (IPv6)
Seems like an artificial limitation to me. If they go and disable NTP sync, they can also disable NTP offering. Maybe they have a local GPS attached to the device (I had one once) so don't need to sync upstream but can still offer precise timing for the network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the delay in NTP server startup can be log level info
Co-authored-by: yubiuser <[email protected]> Signed-off-by: Dominik <[email protected]>
Co-authored-by: yubiuser <[email protected]> Signed-off-by: Dominik <[email protected]>
Signed-off-by: yubiuser <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025-01-12 17:55:11.992 CET [214697/T214698] INFO: Received 8/8 valid NTP replies from de.pool.ntp.org
2025-01-12 17:55:11.993 CET [214697/T214698] INFO: Time offset: 2.922946e+05 ms (excluded 0 outliers)
2025-01-12 17:55:11.993 CET [214697/T214698] INFO: Round-trip delay: 2.545059e+01 ms (excluded 0 outliers)
2025-01-12 18:00:05.000 CET [214697/T214698] INFO: Current RTC time is 2025-01-12 16:55:12
2025-01-12 18:00:05.000 CET [214697/T214698] INFO: RTC time set to 2025-01-12 17:00:05
2025-01-12 18:00:05.001 CET [214697/T214698] INFO: Local time is too inaccurate, retrying in 600 seconds before launching NTP server
2025-01-12 18:10:09.323 CET [214697/T214698] INFO: Received 8/8 valid NTP replies from de.pool.ntp.org
2025-01-12 18:10:09.324 CET [214697/T214698] INFO: Time offset: 1.023293e+00 ms (excluded 1 outliers)
2025-01-12 18:10:09.325 CET [214697/T214698] INFO: Round-trip delay: 2.449826e+01 ms (excluded 1 outliers)
2025-01-12 18:10:10.000 CET [214697/T214698] INFO: Current RTC time is 2025-01-12 17:10:10
2025-01-12 18:10:10.003 CET [214697/T214855] INFO: NTP server listening on 0.0.0.0:123 (IPv4)
2025-01-12 18:10:10.003 CET [214697/T214856] INFO: NTP server listening on :::123 (IPv6)
2025-01-12 19:10:10.329 CET [214697/T214698] INFO: Received 8/8 valid NTP replies from de.pool.ntp.org
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/shm-errors-in-ftl-log-for-v6-development/75131/3 |
What does this implement/fix?
This PR has three changes regarding the NTP implementation:
If there was a timeout, we log the used IP address in addition to the host name. This may be useful to determine if only specific servers cause timeouts (as suggested by @deHakkelaar)
Do not issue double warnings when receiving NTP replies fails, e.g. skip the first of these two:
In case the upstream server sends a "kiss code", we interpret and show it (e.g. "access denied" when authentication is required or "rate exceeded" when querying too often). Before, we simply logged
in such a case.
Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.