Re: Bug: Status/Summary of slashdot leap-second crash on new years 2008-2009

From: Kyle Moffett
Date: Sun Jan 04 2009 - 12:20:19 EST


On Sun, Jan 4, 2009 at 5:03 AM, David Newall <davidn@xxxxxxxxxxxxxxx> wrote:
> You're confusing the system of keeping time with those characteristics
> of the real-world which it represents. They are, in fact, two different
> things, hence we regularly adjust the system. Now in the case of UNIX
> and derivatives, the system records the number of seconds since an
> arbitrary point-in-time, and presents a "wall time" (i.e. the time
> displayed by the clock on the wall) using, amongst other things, a set
> of adjustment rules codified by a zoneinfo file. The number of second
> between 1 minute to- and midnight-ending 31 December is 61. If Linux
> does not reflect that it is wrong and must be fixed. If it isn't fixed
> we will increasingly discover a discrepancy between time-data that
> originates on Linux versus other, correct systems.
>
> I don't understand why such a simple thing was unnecessarily
> complicated. And causing crashes! Ha ha ha or what? A simple addition
> to zoneinfo was (and still is) all that is required.

Leap seconds are an integral part of the NTP standard for the reasons
I described. You can't "update zoneinfo" because a leap second is
applied to *all* timezones... not just a single one. Specifically,
each NTP message includes some bits indicating what the next
leap-second is going to be (at the end of the current month), whether
+1, 0, or -1.

I believe that under Linux if you request a monotonic clock then you
won't "experience" leap-seconds at all; although such a clock will
probably stop while your computer is suspended. On the other hand, if
you explicitly ask for a wall-clock, it is the responsibility of NTP
to keep the wall-clock accurate to the actual passage of days, even if
that involves slight slewing adjustments.

The UTC timezone is explicitly defined to include "leap seconds", and
so we cannot honestly claim to implement the standard unless we
provide a method for those leap seconds to be applied. If you don't
want leap-seconds, submit a patch to the ntp daemon to allow it to run
in "UT1" mode in which it will ignore leap second notifications over
the NTP protocol, or just use a GPS clock.

Cheers,
Kyle Moffett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/