Pivoting
Eric S. Raymond
esr at thyrsus.com
Tue Apr 25 13:58:10 UTC 2017
Hal Murray <hmurray at megapathdsl.net>:
> More pivoting....
>
> pylib calls ntp.ntpc.lfptofloat() in several places
>
> ntpc_lfptofloat() calls lfp_stamp_to_tspec()
> That's an inline which calls ntpcal_ntp_to_time()
>
> ntpcal_ntp_to_time takes an optional second argument, the pivot time.
> If it's NULL, it uses "now".
That is correct. It is a known bug in the Python tools (I think we
inherited this from the C versions) that they can easily fail when
querying a server based in a different era if the local clock has not
yet been synced properly. Thanks for reminding me of this; I will add
bug warnings to the ntpq and ntpmon manual pages.
> The code in step_systime() is really really ugly. (to my eye)
Not just to yours...
> It starts by computing the pivot. It gets the build time as a broken down
> struct, subtracts 10 years, converts back to a time_t. All that can be
> precomputed.
>
> It converts the step to a l_fp, gets the system time as a tspec, converts
> that to l_fp, adds them together, then converts back to a tspec. That
> convert back uses the pivot.
>
> Now that we have a nice simple EPOCH, I hope somebody cleans that up.
This is a major work item, but it's not an urgent one - we have 14 years
to get a fix working and deployed. Discussion of pivoting vs. sanity
checking is still heavy; I want to see us arrive at some sort of
mutually checking consnsus before we cut code.
> Does the 10 year step back make any sense?
Not to me. I've added it to the list of work items as a mystery to be
plumbed.
--
<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>
Please consider contributing to my Patreon page at https://www.patreon.com/esr
so I can keep the invisible wheels of the Internet turning. Give generously -
the civilization you save might be your own.
More information about the devel
mailing list