[ntp:questions] Google and leap seconds

unruh unruh at wormhole.physics.ubc.ca
Tue Sep 20 20:56:02 UTC 2011

On 2011-09-20, Marco Marongiu <brontolinux at gmail.com> wrote:
> Hello
> An official Google blog post[1] drove me to this question: if the OS
> implements the kernel discipline, and we have a positive leap second, do
> we expect that the time will step back one second when the leap second
> is inserted?
> The question arose after mumbling a bit about the blog post.
> In the post, a Google engineer says that: "Computers traditionally
> accommodate leap seconds by setting their clock backwards by one second
> at the very end of the day."

No they do not. They insert an extra second ( second number 60) into the
time stream. Ie, the last second of the month becomes 23:59:60 rather
than 23:59:59, as you state below. 

While ntp eventually steps the clock if the system does not understand
leap seconds, chrony will slew the clock  to gain the extra second. 

> By the way, in the NTP FAQ[2] I read: "If the operating system
> implements the kernel discipline [...] the kernel will handle the leap
> seconds without further action necessary. If the operating system does
> not implement the kernel discipline, [...] the situation will be handled
> just like an unexpected change of time: [...] eventually ntpd will step
> the time."
> So I expect that OSs implementing the kernel discipline will go through
> 23:59:58 -> 23:59:59 -> 23:59:60 -> 00:00:00
> in case of a positive leap second, and
> 23:59:58 -> 00:00:00 -> 00:00:01
> in case of a negative one. This shouldn't have any negative effect on
> applications, unless they are designed to always expect second 00 to
> follow 59.
>>From Dr.Mills' pages[3] I understand that the kernel discipline is
> implemented at least in "Solaris, Tru64, FreeBSD and Linux, and possibly
> others".
> Now, I don't know what OSs Google is referring to in that blog post, but
> I'd expect it is one of those listed above. And they are saying they had
> to do something because in 2005 their computer clocks stepped back one
> second and screwed their apps.
> That's why I think that I am missing something, and hence the question
> above: are leap seconds supposed to be managed by stepping back the
> clock when using NTP? Or wasn't it that the OS at the time of the fault
> didn't support the KD, or had a faulty management of the leap seconds?
> Or, maybe, it was their apps's fault?

Maybe they were running windows?

> Can anyone help me understand?
> Thanks in advance
> Ciao
> -- bronto
> [1]
> http://googleblog.blogspot.com/2011/09/time-technology-and-leaping-seconds.html
> [2] http://www.ntp.org/ntpfaq/NTP-s-algo-real.htm#AEN2499
> [3] http://www.eecis.udel.edu/~mills/ntp/html/extern.html

More information about the questions mailing list