|
|
Log in / Subscribe / Register

A GPSD time warp

A GPSD time warp

Posted Aug 4, 2021 21:30 UTC (Wed) by NYKevin (subscriber, #129325)
Parent article: A GPSD time warp

> Beyond that, it is possible that a negative leap second may be coming relatively soon, but the code is not written with that in mind.
>
> Miller said that up until 2020, "leap seconds had been very predicable", but that recent findings about an increase in the earth's rotational speed have changed that—raising the possibility of a negative leap second. The code in question was aimed at the regression tests, however, not the path for handling live GPS messages, which was another part of the problem.

Miller is not wrong. A negative leap second would be unprecedented (which doesn't mean it won't happen). I anticipate that a lot of leap-second-sensitive technologies will break on it. Fortunately, nptd's leap smearing should(!) be able to support both positive and negative leap seconds, and anything running on smeared time should(!) be blissfully ignorant of the discontinuity. This is also the case with AWS and GCP, both of which give you smeared time by default.

For the uninitiated: Leap smearing involves gradually slewing the clock over an extended period of time in such a way that time remains perfectly continuous and doesn't disagree very much with the "real world," in terms of both frequency and offset. If you use a linear smear centered on the leap second, the maximum offset is 0.5 seconds at the moment of the leap second itself - which is only a little more than plausible network RTT, so most technologies don't care. Similarly, if your linear smear lasts for a full 24 hours (which is the typical/recommended configuration), then the frequency only changes by 1 part in 86,400, which turns out to be pretty insignificant. Nevertheless, if you have e.g. legal reasons to require sub-second accuracy, then this may not work for your use case. But the people in that boat are already screwed anyway, because none of the standard POSIX time APIs can tell the difference between 23:59:59 and 23:59:60 in the first place.

As for Miller not wanting to backport the fix: If he doesn't have the resources or desire to maintain a stable branch, then that's his decision. The distros will do the backporting, or not, as they see fit.


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds