The leap second concept was first introduced in 1972 by the International Earth Rotation and Reference Systems Service (IERS) in an attempt to periodically update Coordinated Universal Time (UTC) due to imprecise observed solar time (UT1) and the long-term slowdown in the Earths rotation. This periodic adjustment mainly benefits scientists and astronomers as it allows them to observe celestial bodies using UTC for most purposes. If there were no UTC correction, then adjustments would have to be made to the legacy equipment and software that synchronize to UTC for astronomical observations.
As of today, since the introduction of the leap second, UTC has been updated 27 times.
While the leap second might have been an acceptable solution in 1972, when it made both the scientific community and the telecom industry happy, these days UTC is equally bad for both digital applications and scientists, who often choose TAI or UT1 instead.
At Meta, were supporting an industry effort to stop future introductions of leap seconds and stay at a current level of 27. Introducing new leap seconds is a risky practice that does more harm than good, and we believe it is time to introduce new technologies to replace it.
One of many contributing factors to irregularities in the Earths rotation is the constant melting and refreezing of ice caps on the worlds tallest mountains. This phenomenon can be simply visualized by thinking about a spinning figure skater, who manages angular velocity by controlling their arms and hands. As they spread their arms the angular velocity decreases, preserving the skaters momentum. As soon as the skater tucks their arms back in the angular velocity increases.
So far, only positive leap seconds have been added. In the early days, this was done by simply adding an extra second, resulting in an unusual timestamp:
23:59:59 -> 23:59:60 -> 00:00:00
At best, such a time jump crashed programs or even corrupted data, due to weird timestamps in the data storage.
With the Earths rotation pattern changing, its very likely that we will get a negative leap second at some point in the future. The timestamp will then look like this:
23:59:58 -> 00:00:00
The impact of a negative leap second has never been tested on a large scale; it could have a devastating effect on the software relying on timers or schedulers.
In any case, every leap second is a major source of pain for people who manage hardware infrastructures.
More recently, it has become a common practice to smear a leap second by simply slowing down or speeding up the clock. There is no universal way to do this, but at Meta we smear the leap second throughout 17 hours, starting at 00:00:00 UTC based on the time zone data (tzdata) package content.
Lets break this down a bit.
We chose a 17-hour duration primarily because smearing is happening on Stratum 2, where hundreds of NTP servers perform smearing at the same time. To ensure that the difference between them is tolerable, the steps must be minimal. If the smearing steps are too big, NTP clients may consider some devices faulty and exclude them from quorum, which may lead to an outage.
The starting point at 00:00:00 UTC is also not standardized, and there are many possible options. For example, some companies begin smearing at 12:00:00 UTC the day before and throughout 24 hours; some do so two hours before the event, and others right at the edge.
There are also different algorithms on the smearing itself. There is a kernel leap second correction, linear smearing (when equal steps are applied), cosine, and quadratic (which Meta uses). The algorithms are based on different mathematical models and produce different offset graphs:
The source of the leap indicator differs between GNSS constellations (e.g., GPS, GLONASS, Galileo, and BeiDou). In some cases, it is broadcast by satellites several hours in advance. In other cases, time is propagated in UTC with the leap already applied. In different constellations, the leap second value differs depending on when it was launched.
All of this requires the nontrivial conversion logic inside of the time sources, including our very own Time Appliance. Loss of a GNSS signal during such a sensitive time may lead to a loss of a leap indicator and a split-brain situation, which could lead to an outage.
The leap event is also propagated via tzdata package months in advance, and for ntpd fans, via a leap second file distributed through the Internet Engineering Taskforce (IETF) website. Not having a fresh copy of the file may lead to forgetting about a leap second and causing an outage.
As already mentioned, the smearing is a very sensitive moment. If the NTP server is restarted during this period, we will likely end up with either old or new time, which may propagate to the clients and lead to an outage.
Because of such ambiguities, public NTP pools dont do smearing, sometimes passing a leap indicator to the clients to figure this out. SNTP clients usually end up stepping the clock and dealing with the consequences described earlier. Smarter clients may choose a default strategy to smear the leap locally. All in all, this means big players like Meta, who perform smearing on public services, cant join the public pools.
And even after the leap event, things are still at risk. NTP software needs to constantly apply offset compared to the source of time its using (GNSS, TAI, or Atomic Clock), and PTP software needs to propagate a so-called UTC offset flag in the announce messages.
The leap second and the offset it creates cause issues all over the industry. One of the simplest ways to cause an outage is to bake in an assumption of time always going forward. Say we have a code like this:
start := time.Now()
// do something
spent := time.Now().Sub(start)
Depending on how spent is used, we may end up in a situation relying on a negative value during a leap second event. Such assumptions have caused numerous outages, and there are plenty of articles that describe these cases.
Back in 2012, Reddit experienced a massive outage because of a leap second; the site was inaccessible for 30 to 40 minutes. This happened when the time change confused the high-resolution timer (hrtimer), sparking hyperactivity on the servers, which locked up the machines CPUs.
In 2017, Cloudflare posted a very detailed article about the impact of a leap second on the companys public DNS. The root cause of the bug that affected their DNS service was the belief that time cannot go backward. The code took the upstream time values and fed them to Gos rand.Int63n() function. The rand.Int63n() function promptly panicked because the argument was negative, which caused the DNS server to fail.
Its worth mentioning that Go, in particular, relies on a monotonic clock, and in most cases, is less susceptible to such issues.
Leap second events have caused issues across the industry and continue to present many risks. As an industry, we bump into problems whenever a leap second is introduced. And because its such a rare event, it devastates the community every time it happens. With a growing demand for clock precision across all industries, the leap second is now causing more damage than good, resulting in disturbances and outages.
As engineers at Meta, we are supporting a larger community push to stop the future introduction of leap seconds and remain at the current level of 27, which we believe will be enough for the next millennium.
Read the rest here:
It's time to leave the leap second in the past - Facebook Engineering
- 10 books thatll help you become a better software engineer - The Next Web [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Total hands out UKCS engineering framework deals to trio of consultants - News for the Oil and Gas Sector - Energy Voice [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Prometheus: Why The Engineers Were Heading To Earth | Screen Rant - Screen Rant [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Management CEMETERY SUPERINTENDENT The City of Gibbon is currently accepting - Kearney Hub [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Transportation Engineering and Safety Conference to be held Dec. 9-11 - Penn State News [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- 'Bending' light to engineer improved optical devices and circuits - ND Newswire [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- UC Merced Engineering Center to Focus on Ag Technology - AG INFORMATION NETWORK OF THE WEST - AGInfo Ag Information Network Of The West [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Head of Engineering Maintenance job with DURHAM UNIVERSITY | 233561 - Times Higher Education (THE) [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Civil Engineering student part of National Women in Engineering "Dream Team" panel - uoflnews.com [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Breaking News - Engineering at Its Best... and Worst: Don't Miss the Return of Science Channel's Hit Series "Deadly Engineering" and... [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Tesla is No. 1 most attractive company for engineering students, and thats a massive advantage - Electrek [Last Updated On: November 11th, 2020] [Originally Added On: November 11th, 2020]
- Wolves alter wetland creation and recolonization by killing ecosystem engineers - UMN News [Last Updated On: November 17th, 2020] [Originally Added On: November 17th, 2020]
- Global Automotive Simulation Market To Witness Astonishing Growth 2026 | Altair Engineering Inc., ANSYS Inc., PTC, Siemens AG, Autodesk Inc.,... [Last Updated On: November 17th, 2020] [Originally Added On: November 17th, 2020]
- Engineers Without Borders urges industry reflection - The Engineer [Last Updated On: November 17th, 2020] [Originally Added On: November 17th, 2020]
- 9 Engineers on the Hardest Song They Ever Mixed - Vulture [Last Updated On: November 17th, 2020] [Originally Added On: November 17th, 2020]
- Daewoo Engineering and Construction and SPH Engineering disclose AI partnership - sUAS News [Last Updated On: November 17th, 2020] [Originally Added On: November 17th, 2020]
- TRIPLE EIGHT BATHURST WINNING ENGINEER TO JOIN WAU - Auto Action [Last Updated On: November 24th, 2020] [Originally Added On: November 24th, 2020]
- First-year engineering classes for Anna University affiliated colleges take the e-way from today - The New Indian Express [Last Updated On: November 24th, 2020] [Originally Added On: November 24th, 2020]
- Datafold raises seed from NEA to keep improving the lives of data engineers - TechCrunch [Last Updated On: November 24th, 2020] [Originally Added On: November 24th, 2020]
- Tech has overtaken engineering as Bristol's fastest-growing industry with more than $1.07bn invested in the city since 2014 - Business Leader [Last Updated On: November 24th, 2020] [Originally Added On: November 24th, 2020]
- Start 2021 as an electrical engineer with this training for less than $20 - Boing Boing [Last Updated On: November 24th, 2020] [Originally Added On: November 24th, 2020]
- The Global Engineering Plastics Market is expected to grow by $ 43.00 bn during 2020-2024 progressing at a CAGR of 8% during the forecast period -... [Last Updated On: November 24th, 2020] [Originally Added On: November 24th, 2020]
- Elementary students test their engineering skills with Mayflower project - williamsonherald.com [Last Updated On: November 24th, 2020] [Originally Added On: November 24th, 2020]
- Global Architectural Engineering and Construction Solutions (AECS) Market 2020-2024 | Market Analysis, Drivers, Restraints, Opportunities, and Threats... [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- American Institute of Chemical Engineers Celebrates Organizations and Leaders for Doing a World of Good - GlobeNewswire [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- 2 Texas Engineers Honored Among Top Inventors in US - UT News - UT News | The University of Texas at Austin [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- Chemical engineering alumna named Woman of the Year in Engineering - Penn State News [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- 14 Largest Engineering Companies In The World - Yahoo Finance [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- Vails namesake was a controversial state highway engineer - The Grand Junction Daily Sentinel [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- The Next Frontier of Learning Engineering: AI That Teaches Other AI - EdSurge [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- $496M Contract Will Give DOD Engineering Capabilities, Official Says - Nextgov [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- William H. Robinson has a 'new and expanded leadership' post at Vanderbilt University - BlackEngineer.com [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- Di Appointed to Lead Computer Science and Computer Engineering - University of Arkansas Newswire [Last Updated On: December 14th, 2020] [Originally Added On: December 14th, 2020]
- English is easier: India is woefully underprepared to teach engineering in regional languages - The Times of India Blog [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- VW Bolsters U.S. Footprint With Advancements In Electric Car Portfolio, Infrastructure And Engineering - CarScoops [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- These 4 Measures Indicate That SIA Engineering (SGX:S59) Is Using Debt Reasonably Well - Simply Wall St [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- New engineering business opens its doors in Netherton despite the pandemic - expressandstar.com [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- 'Earables' the next milestone in wearable tech, say engineers - E&T Magazine [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- Senior Lecturer in Mechanical Engineering job with BIRMINGHAM CITY UNIVERSITY | 238845 - Times Higher Education (THE) [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- New collaboration provides opportunity for future water scientists and engineers - Cranfield University [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- Box Opens Research and Development Engineering Site in Warsaw, Poland - Business Wire [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- Engineering and Technology Management students achieve high pass rate on certification exam - Morehead State University News [Last Updated On: December 15th, 2020] [Originally Added On: December 15th, 2020]
- Hydram Engineering warns Covid-19 and Brexit will dent its turnover - Business Live [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- Calculating The Intrinsic Value Of Watts International Maritime Engineering Limited (HKG:2258) - Simply Wall St [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- Is Suprajit Engineering Limited's (NSE:SUPRAJIT) Stock's Recent Performance A Reflection Of Its Financial Health? - Simply Wall St [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- Engineering CAD Software Market is Flourishing due to Rising Emergence of Technical Implementation Drives Growth by 2027 | TurboCAD, SketchUp,... [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- Apple vs. Tesla: Which Offers Software Engineers the Biggest Salaries? - Dice Insights [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- From the classroom: Mechanical engineering at global top 10 uni - Study International News [Last Updated On: January 4th, 2021] [Originally Added On: January 4th, 2021]
- 'A lot of unknowns': Grass Valley Assistant City Engineer Bjorn Jones said the city has adapted under the pandemic - The Union of Grass Valley [Last Updated On: January 31st, 2021] [Originally Added On: January 31st, 2021]
- Associate Professor in Broadcast Engineering job with BIRMINGHAM CITY UNIVERSITY | 243677 - Times Higher Education (THE) [Last Updated On: January 31st, 2021] [Originally Added On: January 31st, 2021]
- CORRECTING and REPLACING: KCI, One of the Top Engineering Firms in the US, Adopts ProStar's PointMan SaaS Solution for SUE - Business Wire [Last Updated On: January 31st, 2021] [Originally Added On: January 31st, 2021]
- Purdue's online engineering graduate programs again rank in the top 3 nationally - Purdue News Service [Last Updated On: January 31st, 2021] [Originally Added On: January 31st, 2021]
- Faculty Positions of Intelligent Engineering and Microelectronics job with South China University of Technology (SCUT) | 314652 - The Chronicle of... [Last Updated On: January 31st, 2021] [Originally Added On: January 31st, 2021]
- Examining the Engineering of the Kasukabe Reservoir in Japan - Interesting Engineering [Last Updated On: January 31st, 2021] [Originally Added On: January 31st, 2021]
- Home - Springer [Last Updated On: January 31st, 2021] [Originally Added On: January 31st, 2021]
- SIA Engineering ekes out small profit in third quarter - Flightglobal [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- ST Engineering Launches Anti-Microbial Solution Approved for Use in Cabin Interiors - AviationPros.com [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- Journey Engineering announces the addition of a new VP and Principal, Projects and Engineering - BOE Report [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- K-2 Ventures Advises Mark Two Engineering on Its Sale to CORE Industrial Partners - Business Wire [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- Global Engineering Liability Insurance Market latest demand by 2020-2025 with leading players & COVID-19 Analysis KSU | The Sentinel Newspaper -... [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- First recipient of the Black Engineer of the Year Award is appointed Deans' Professor in Education and Engineering - BlackEngineer.com [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- Google will pay $2.5 million to underpaid female engineers and overlooked Asian applicants - The Verge [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- Clay County teen whose dream is to be an astronaut introduces other girls to STEM pursuits - The Florida Times-Union [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- Universal Engineering Sciences Strengthens Western Expansion By Acquiring Construction Testing & Engineering, Inc., In Southern California -... [Last Updated On: February 2nd, 2021] [Originally Added On: February 2nd, 2021]
- U.S. Navy Has Patents on Tech It Says Will Engineer the Fabric of Reality - VICE [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- Cummins and Isuzu collaborate on mid-range powertrains and advanced engineering - Engine Technology International [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- Liberty engineering teams helmet prototype earns second place in NFLs 1st and Future competition - WFXRtv.com [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- FM Global executive on the insurer's risk-engineering based approach - Insurance Business Australia [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- Black former NASA engineer: We have to teach our children well - WFXRtv.com [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- Cummins and Isuzu announce global mid-range powertrain and advanced engineering collaboration - Automotive World [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- University of Iowa College of Engineering receives diversity recognition, but still has work to do - UI The Daily Iowan [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- Darin Gray Named Engineer of the Year - USC Viterbi | School of Engineering - USC Viterbi School of Engineering [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- Rubrik transitions to new phase as sales and engineering heads leave Blocks and Files - Blocks and Files [Last Updated On: February 5th, 2021] [Originally Added On: February 5th, 2021]
- A*Star scientist Jackie Ying elected to prestigious US engineering academy based on work in Singapore - The Straits Times [Last Updated On: February 14th, 2021] [Originally Added On: February 14th, 2021]
- A Disillusioned ExxonMobil Engineer Quits to Take Action on Climate Change and Stop Making the World Worse - InsideClimate News [Last Updated On: February 14th, 2021] [Originally Added On: February 14th, 2021]
- USC Junior Advances Communities By Engineering Infrastructures That Serve The People - USC Viterbi | School of Engineering - USC Viterbi School of... [Last Updated On: February 14th, 2021] [Originally Added On: February 14th, 2021]
- Join us on Saturday, Feb. 13 at 7:00 pm EST for the Black Engineer of the Year Awards - BlackEngineer.com [Last Updated On: February 14th, 2021] [Originally Added On: February 14th, 2021]
- Sebastian Ceria Elected to the National Academy of Engineering - Salamanca Press [Last Updated On: February 14th, 2021] [Originally Added On: February 14th, 2021]
- Three Harvard Professors Elected to the National Academy of Engineering | News - Harvard Crimson [Last Updated On: February 14th, 2021] [Originally Added On: February 14th, 2021]
- Newsmaker: South Shore native working on NASA space telescope - The Patriot Ledger [Last Updated On: February 14th, 2021] [Originally Added On: February 14th, 2021]