Re: [chrony-dev] Wake from sleep on OS X

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


> On 1/12/2015, at 9:00 PM, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:
> 
> On Tue, Dec 01, 2015 at 11:14:51AM +1300, Bryan Christianson wrote:
>> When the machine wakes up I see syslog messages such as:
>> Dec  1 00:00:28 number9 chronyd[3450]: Forward time jump detected!
>> Dec  1 00:00:52 number9 chronyd[3450]: System clock wrong by 5.978007 seconds, adjustment started
>> Dec  1 07:30:07 number9 chronyd[3450]: Forward time jump detected!
>> Dec  1 07:30:31 number9 chronyd[3450]: System clock wrong by 6.672551 seconds, adjustment started
>> Dec  1 08:10:13 number9 chronyd[3450]: Forward time jump detected!
>> Dec  1 08:10:37 number9 chronyd[3450]: System clock wrong by 6.625014 seconds, adjustment started
>> 
>> And then it can take a couple of minutes before the local offset converges to something less than a millisecond.
> 
> It looks like the RTC is off by 6 seconds. Is it not synchronized by
> the kernel automatically?

I am not sure what mechanisms are used when the kernel sleeps. I would expect the RTC to have been updated but maybe it isn't. Apple docs don't seem to cover this very well. I've been unable to find anything equivalent to hwclock to do the RTC update.

When chronyd wakes from sleep, won't it see the abrupt change in time as a step and start compensating for that? 

In SCH_MainLoop(),  'saved_time' would be the time before sleep and 'now' would be the current time. This would trigger the warning from check_current_time()

I was thinking maybe the scheduler should do nothing until the system notifies that it is fully awake and then it may need to reset some internal state.

> It's not clear to me what the result should be. Faster detection of
> the forward time jump, or faster adjustment of the clock when it's
> detected?

I think we could be detecting a jump when there is none, just that we have inconsistent state for the first cycle on wakeup and then start compensating for differences that don't exist.

-- 
Bryan Christianson
bryan@xxxxxxxxxxxxx




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