Re: [chrony-dev] Fw: leap seconds correction

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


On Wed, 12 Feb 2014, Miroslav Lichvar wrote:

On Wed, Feb 12, 2014 at 02:14:06AM +0100, Marek Behun wrote:
 http://www.ucolick.org/~sla/leapsecs/right+gps.html

The last two paragraphs on that page imply that chrony smears the leap
second, that's not true. Similarly to ntpd, it just tells the kernel
to insert/delete the leap second and the Linux kernel does it by
stepping the clock back/forward by one second at midnight.

No, the kernel never steps back. It "stops" the clock, but if there is any
request for time from the kernel during that time, it ensures that each
successive request delivers a slightly (microseconds) later time than the
earlier one during that period.


I was thinking about how to do this the best way and I have decided to
write a compatibility library (which will override time
getting/setting system calls with LD_PRELOAD), so the code of
ntp/chrony or any other software that needs to think system clock is
represented in classic POSIX timestamp doesn't need to be changed.
You can find it at https://github.com/elkablo/time2posix .

That's pretty cool.

Did you test how it works during leap second? I suspect the ambiguity
in the UTC->right conversion when leap second is inserted could cause
some troubles. In linuxptp (PTP uses TAI) the problem is avoided by
suspending the operation during that second. I think chronyd and ntpd
would need to do that too.

Also, you might need to intercept recv() and similar to adjust the
timestamps in the SO_TIMESTAMP and SO_TIMESTAMPING control messages.



--
William G. Unruh   |  Canadian Institute for|     Tel: +1(604)822-3273
Physics&Astronomy  |     Advanced Research  |     Fax: +1(604)822-5324
UBC, Vancouver,BC  |   Program in Cosmology |     unruh@xxxxxxxxxxxxxx
Canada V6T 1Z1     |      and Gravity       |  www.theory.physics.ubc.ca/

--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/