Applying it to millions of individual servers with different OSes? I'll make the popcorn.
Applying it to millions of individual servers with different OSes? I'll make the popcorn.
A leap second is over in a second. With leap smear you are out of sync with the rest of the world for many hours. And, there are at least three different leap smear schemes I know of: a massive judgment failure that happens again and again.
The sensible alternative would be to eliminate leap seconds entirely for a few decades, and maybe stage a leap minute, eventually, or a leap hour in some far-off century, or never. It doesn't matter if the sun is ever exactly overhead at noon, because it isn't anyway, almost everywhere.
There's also the exciting version where some of your time servers do it one way, and some do another; you could probably pick two traditional servers, and then one of each of the others and have a really terrible day. From experience with a setup where 4 servers were traditional and one was smeared, there was a lot of variation in time; but thankfully my systems weren't relying on time measured on different servers to be very consistent.
IMHO, leap smear probably should have been done with standard time on the wire, and the host agent doing the smear. But that would be more effort than doing it on the time servers, so there you go.
Pre-Y2K there was a lot of fuss and hand-wringing, but there was also a lot of software development that happened to ensure that Y2K would not be a disaster. So then when Y2K rolled around the preparations mostly worked.
My first programming job in high school was over-hauling a (mainframe-hosted) code base for handling lab data at a hospital. This was in the mid-90's; before most of the Y2K fuss had started. Without my work, pee and poo samples would be time traveling from the late Victorian era. You're welcome.
But then all anyone ever sees is that nothing went wrong, and they assume it was nothing to begin with.
Just change your time zone offsets at that point, honestly.
The problem isn't one where you hold your breath and squeeze your eyes shut for a second while the unpleasantness passes. The problem is when you have tons of code running and you don't know exactly how it'll deal with this very rare event.
If you're faced with an upcoming leap second there are various ways of dealing with it. One way is to do an audit of the code and hope that you can verify the most important parts. Another way is to smear and hope that most programs won't be negatively affected by reported seconds being 0.00001s off.
There are other options, but I don't think there's an "obviously correct way".
> There are other options, but I don't think there's an "obviously correct way".
Well, there are ways that following reality more and less. There are also ways that have legal traceability to time sources in some regulated industries.
Another issue is that a positive leap second cannot be represented using time_t-like representations. But at least every time_t value maps to a UTC time.
By contrast a negative leap second, should one occur, will cause a permanent illegal time_t value that has no existence in UTC. Checking for that illegal value in every piece of code that uses time_t values will not be fun.
Positive leap seconds, when translated into a dumb format and back, can be off by a second and won't round trip properly.
Negative leap seconds, when translated out of a dumb format and back, can be off by a second and won't round trip properly.
Seems pretty close to me.
The FreeBSD folks test for this:
* https://lists.freebsd.org/pipermail/freebsd-stable/2020-Nove...
The kernel and ntpd are fine with it. Applications: ¯\_(ツ)_/¯
Too late, your IoT-enabled microwave just crashed and can't heat up the kernels