[ale] OT ntp - leap second - how many knew what this was 3 weeks ago

mike at trausch.us mike at trausch.us
Wed Jul 4 11:23:45 EDT 2012


On 07/04/2012 10:39 AM, Ron Frazier (ALE) wrote:
> I find this very interesting, and somewhat scary as a potential
> programmer. Since I'm thinking of learning programming again, and since
> I have an interest in timekeeping, I have considered writing a world
> clock program etc., to show the time in different parts of the world.
> However, prior to my NTP research, I never knew about the leap second.
> So, there would have been a good possibility, had I written the program
> prior to this year, that my program would have crashed as well.

Many things, from operating system kernels to applications which have to
deal with extremely odd operating conditions, crash when time changes in
unexpected ways.

Some systems implement the leap second such that the time follows this
sequence:

  23:59:58
  23:59:59
  23:59:59
  00:00:00

But, not perfectly.

So, for example, the following *could* happen:

  June 30, 2012 23:59:58
  June 30, 2012 23:59:59
  July 01, 2012 00:00:00 (but just ever so briefly)
  June 30, 2012 23:59:59
  July 01, 2012 00:00:00
  July 01, 2012 00:00:01

Now, if your application is time-driven, that makes it sensitive to
disturbances in the time as it experiences it.  When seconds repeat and
can even go backwards as the result of various race conditions and so
forth, that's a problem.

Now, this is usually offset by applications getting their time derived
from standard time; the use of standard time for audit logs and so forth
makes it possible to have all the absolute information about when an
event occurred, because standard time doesn't change twice (or more) in
a year like local time does.

But some of those systems repeat the "standard time" second, which can
also confuse time-driven applications.

Timekeeping is something that has fascinated me a lot over the years,
and it is something that is so chock-full of strange rules and
exceptions that it is extremely complex to do it properly in the context
of computer software.  For that matter, operating system kernels need a
lot of support from the outside world to get the time right on their own
systems.

In any case, every time there is a leap second, something, somewhere
crashes.  It's far easier to skip a second than it is to add one.

	--- Mike

-- 
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
                                   --- Carveth Read, “Logic”



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 729 bytes
Desc: OpenPGP digital signature
Url : http://mail.ale.org/pipermail/ale/attachments/20120704/883fa5e4/attachment.bin 


More information about the Ale mailing list