Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Does the Leap Second Cause Problems?

So at this moment (but most likely not for long) Reddit, Meetup, Fark, LinkedIn, Yelp, 4Chan are all down. Netflix apparently was out for a while too.

According to Reddit's tweet, they are having issues relating to the Leap Second from 6/30/2012: https://twitter.com/redditstatus/status/219244389044731904

"We are having some Java/Cassandra issues related to the leap second at 5pm PST. We're working as quickly as we can to restore service."

Apparently, the issues affecting the other sites are all related to a leap second issue.

After reading Wikipedia article on Leap seconds, I think I understand what leap seconds are... but what I don't get is what kind of weird behaviors can happen if leap second isn't accounted for? And how, as programmers, should we prepare for leap seconds when we code and configure servers?

I mean it's only one second isn't it?

like image 888
K2xL Avatar asked Jul 01 '12 02:07

K2xL


People also ask

What is leap second problems?

A leap second is a one-second adjustment that is occasionally applied to Coordinated Universal Time (UTC), to accommodate the difference between precise time (International Atomic Time (TAI), as measured by atomic clocks) and imprecise observed solar time (UT1), which varies due to irregularities and long-term slowdown ...

Why are leap seconds Important?

Scientists have added an extra second 27 times since 1972 to keep atomic clocks in sync with astronomical time. Tech companies hate the practice because it can wreak havoc on precise technological systems that are much better at telling time than humans are — at least until we insert an extra second.

How do you handle a leap second?

When a leap second is inserted to UTC, the system clock skips that second as it can't be represented and is suddenly ahead of UTC by one second. There are several ways how the clock can be corrected. The most common approach is to simply step the clock back by one second when the clock gets to 00:00:00 UTC.

When was the last time we had a leap second?

The last leap second was December 31, 2016. Since they always add leap seconds on the last day of June or December, the next possible date for a leap second is June 30, 2022. Timekeepers have added leap seconds 27 times since 1972. There were leap seconds added on June 30, 2015, and on June 30, 2012.


1 Answers

Certain Linux kernels (versions before 2.6.29) have issues handling leap seconds, to the point where it can cause a kernel panic. Other Linux kernels can suffer from a livelock. This obviously has detrimental effects for the system, given that it requires a reboot.

Here's the related ServerFault question on this topic, since it's really a Linux server issue.

like image 118
Amber Avatar answered Oct 22 '22 06:10

Amber