[ntp:hackers] Leap second support in versions prior to 4.2.6

Greg Dowd gdowd at symmetricom.com
Mon Jun 4 15:29:05 UTC 2012


My bigger regret with leap seconds is the loss of monotonicity that happened somewhere along the way.  Years ago, Dave's web notes on leap seconds used to discuss the fact that leap seconds could be differentiated from the previous second (to insertion) by the fact that one second had the leap pending bit set and one had it cleared.  My system designs always supported this functionality until we started using the public domain code.  At some point, the testers reported that the bits are not cleared until some point after the leap event, dependent on the box configuration (e.g., up to 16s for my GPS ref clock to 16m for net).  Dave's position now is that this is not important to distinguish and that the bit only needs to be cleared sometime before it is misinterpreted as applying to the next midnight.  My position is that it can be interpreted that way 1s after midnight for long poll devices like modes and is not elegant the way it is.  And so, there is no instantaneous method to detect whether a timestamp is "leaping" or not or to precisely determine whether the bit applies to a particular day.  This is one of the underlying reasons why we start to talk about leap "windows", or at least, hysteresis for leap events.  I understand that most people don't care but precision users are often impacted by these choices.  Other timecodes are much more precise in their definition (PTP or IRIG for instance).

As for leap deletion, we do design and test for it, but I agree that you might not want to wire transfer your bank funds or fly on autopilot during those events.  I'm also a bit concerned about what might have happened to the Earth to make that event necessary :-)





Greg Dowd
gdowd at symmetricom dot com (antispam format)
Symmetricom, Inc.
www.symmetricom.com
"A clever person solves a problem.  A wise person avoids it." Albert Einstein


-----Original Message-----
From: hackers-bounces+gdowd=symmetricom.com at lists.ntp.org [mailto:hackers-bounces+gdowd=symmetricom.com at lists.ntp.org] On Behalf Of Brian Utterback
Sent: Monday, June 04, 2012 7:42 AM
To: Warner Losh
Cc: Mike S; hackers at lists.ntp.org
Subject: Re: [ntp:hackers] Leap second support in versions prior to 4.2.6

On 06/03/12 19:41, Warner Losh wrote:
> One of the problems with leap seconds is exactly this. While they 
> could be at the end of any month, they have only ever been at the end 
> of June and December. Many systems, including NTPd, assume that's the 
> only time they can occur. So while the letter of the spec says any 
> month, I doubt there are any systems that could handle a leap second 
> at the end of March, let alone at the end of January.

Looking at the leap second code in ntp-dev, it appears to me that a 
handful of the refclock drivers make this assumption, but nothing in the 
NTP code itself does. The leap processing will happily use whatever the 
upstream servers say or the leapfile. The leapfile gives the time of the 
insertion to the second, so it is completely arbitrary. Most operating 
systems with leap second support will insert the leap second at the end 
of the day the flag is set. So, I would have to say that your statement 
is not generally true.

Of much more concern to me would be the possibility of a leap second 
deletion. I bet a whole bunch of things would break if one of those ever 
happens.

-- 
blu

Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. - Martin Golding
-----------------------------------------------------------------------|
Brian Utterback - Solaris RPE, Oracle Corporation.
Ph:603-262-3916, Em:brian.utterback at oracle.com

_______________________________________________
hackers mailing list
hackers at lists.ntp.org
http://lists.ntp.org/listinfo/hackers


More information about the hackers mailing list