Re: [chrony-dev] Handling of leap seconds

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


Hello Miroslav,

I have a follow up question regarding this. I found that the REF_IsLeapSecondClose() function uses the system time to check if a leap second occurrence is close.
Under the circumstances whereby system time has not yet synchronized, wouldn't it be more correct to use timestamp from time sources for this check?

On Tue, Mar 10, 2020 at 3:15 PM Dennis Law <cmlaw1993@xxxxxxxxx> wrote:
Hello Miroslav,

Thank you for the clarification. This makes sense now. I was just wondering why this 5 second check is there and could not figure out why.

Thank you.


On Thu, 5 Mar 2020, 11:49 pm Miroslav Lichvar, <mlichvar@xxxxxxxxxx> wrote:
(replying from an archive)

On Sun, 01 Mar 2020, Dennis Law wrote:
> It seems that when the program finds out about a leap second
> occurrence too close to the occurrence itself (within 5 seconds), it
> simply does not attempt to correct it.
>
> From my understanding from the code, the program should be able to
> handle leap seconds even right before before it occurs, as it simply
> schedules a timeout at either 00.00.00 (insertion) or 23:59:59
> (deletion).
>
> What is then the reason for the 5 seconds check? Am I missing
> something obvious here?

It prevents measurements from being accumulated and also prevents
changes in the leap second status. The reason is that all kind of
weird things may happen around the leap second (e.g. mixing of
pre-leap and post-leap timestamps causing errors in the offsets, leap
bits being set/cleared prematurely), so it's better to let it coast
through.

Leap seconds are normally announced by reference clocks at least an
hour before the event. Is the 5 second check causing you some issues?

--
Miroslav Lichvar


--
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/