Leap Second

Dave Jones’ post reminded me that tonight we have a leap second. 23:59:59 will be followed by 23:59:60. Wikipedia saves me the trouble of explaining why:

Leap seconds are necessary because time is measured using stable atomic clocks (TAI or International Atomic Time), whereas the rotation of Earth slows down continually, though at a slightly variable rate. Originally, the second was defined as 1/86400 of a mean solar day (see solar time) as determined by the rotation of the Earth around its axis. By the middle of the 20th century it was apparent that the rotation of the Earth did not provide a sufficiently uniform time standard and in 1956 the second was redefined in terms of the annual orbital revolution of the Earth around the Sun. In 1967 the second was redefined, once again, in terms of a physical property: the oscillations of an atom of Caesium-133, which were measurable by an atomic clock. But the solar day becomes 1.7 ms longer every century due mainly to tidal friction (2.3 ms/cy, reduced by 0.6 ms/cy due to glacial rebound).

Mr. Jones’ blog post has a different point, though. Tonight all of our servers are going to run a section of code that gets used very rarely, and as such really isn’t time-tested:

This all sounds fairly benign, but it has been known to be problematic. For reasons I’m not entirely sure of, ntp still calls into the kernel twice a year, regardless of whether a leap second is inserted or not. So, twice a year, we end up in different code paths that we don’t execute the rest of the year.

I wonder how many rarely-used code paths there are like this, in drivers, in kernels, in databases and software, quietly rotting until they get triggered one day, and then everything comes crashing down. It sure makes efforts like automatic crash dump reporting seem useful, because us system administrator types reboot the machines, restart the software, and wait for it to happen again. And it doesn’t. Or if it does we don’t correlate it with the last crash, because that was two years ago. It’s also a big selling point for unit testing.

At any rate, may all your pagers and cell phones stay quiet all night long. Enjoy New Year’s Eve and Day, and stay safe.

Comments on this entry are closed.

  • Just to note, for US folks this does NOT happen at midnight local time, but midnight UTC.

    For us US west coasters, that will of course be 4 PM-ish, eg in about 27 minutes from now…