Leap Second planned for 2016

Chris Adams cma at cmadams.net
Sat Jul 9 04:29:47 UTC 2016


Once upon a time, Patrick W. Gilmore <patrick at ianai.net> said:
> But time _DOES_ flow. The seconds count
> 	58, 59, 60, 00, 01, …
> If you can’t keep up, that’s not UTC’s fault.

Here in the real world of modern computers, virtually everybody has
copied the UNIX/C behavior that doesn't actually allow for 61 seconds in
a minute.  POSIX time_t is defined to be 86,400 seconds per day, with
"(time % 86400) == 0" being midnight UTC.  The conversion from time_t to
(hours, minutes, seconds) documents that minutes can be more or less
than 60 seconds, but it is moot, since the input that the system uses to
actually keep time cannot represent anything but 60-second minutes (and
still be in sync with the outside world).

So, all the systems we use either double count 59 (which means time
jumps backwards, because it goes 59.9999... to 59.0), or count half time
during second 59 (so going from 59.0 to 0.0 takes two actual seconds).
Both have their pluses and minuses, and IIRC both have exposed software
bugs in the past.  The bugs usually get fixed after the leap second, but
the next one always seems to expose new bugs.

Leap second handling code is not well-tested and is an ultimate corner
case.  There's been debate about abolishing leap seconds; with all the
every-day bugs people have to deal with, few people set up a special
test environment to handle something that may never happen again (until
you get less than six months warning that it'll happen at least once
more), and even then, tests tend to focus on what broke before, because
it is really hard to test EVERYTHING.

You can debate the correctness of these things, but you can't really
debate that they are the way things work.

There are experiments to handle leap seconds differently, such as
smearing them over a longer period (up to 24 hours IIRC), but they
require custom time-keeping code and running without any external time
reference during the smear (because there's no standard way to do that).

> As for stopping the leap seconds, talk to the planet Earth. It’s the one who will not conveniently rotate properly. Either that, or run REEEEEEALLY Fast in that -> direction every once in a while. :-)

Leap seconds are inserted to keep the atomic clocks synced with an
arbitrary time base (that is guaranteed to vary forever).  There's
nothing magic about having noon UTC meaning the Sun is directly over 0°
longitude; if we didn't insert leap seconds, it would have drifted
slightly, but so what?

-- 
Chris Adams <cma at cmadams.net>



More information about the NANOG mailing list