[chrony-users] Re: Linux time goes wrong after changing the time with 'date' cmd

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


Hi Rob,

Thanks for the comments!

Something went wrong that my email account didn't got your mail, and
I just saw your reply when I checked the web archive of this mailing
list: https://www.mail-archive.com/chrony-users@xxxxxxxxxxxxxxxxxxxx/

So I manually copy your reply from web  for further discussion :)

Please add my email address feng.tang@xxxxxxxxx so that I have a better
chance to get the email, thanks!

"
  That is not "wrong", that is "right".
  Chrony speeds up the clock so it will gradually go back to the correct time,
  after you changed it to the wrong time.

  command: " date --set '04/24 15:23:10 2024' "

  DON'T DO THAT!!!
  You have synchronized the clock using chrony, DON'T touch it manually!

  Rob
"

I agree, I don't understand why users do that setting either. But we
can't stop user from doing all kinds of crazy things :) The original
'date' command set the time with a huge jump, but even if user set a
small time jump like 10 minutes, we still can notice many things go
worng, like 'sleep' command, 'turbostat' and other programs start to
see broken data. The workaround for the original reporter is disabling
'chronyd' service in systemd to run their performance workload.

So my thought is, since user already chose to trust 'chrony', and
when chrony has more realiable NTP time source, 'chrony' can help to
correct the 'wrong date' set by user with the right time, practically
'rejecting' the huge time jump set by users.

Thanks,
Feng

On Fri, May 10, 2024 at 09:43:25AM +0800, Feng Tang wrote:
> We got a report that the Linux time system went weird after change time
> backwards with command: " date --set '04/24 15:23:10 2024' ", after a
> while (about 200 seconds), they saw strange 10% performance improvment
> for some workload, and also if you run "sleep 60" command and it actually
> will completed in about 54 seconds.
>
> We tested on several HW platforms including desktop and servers, with
> FC 40, Cent OS 9 etc, and different Linux kernel versions like 5.14 and
> 6.8, all can reproduce this.
>
> After debugging, we found if we disable 'chronyd' service, then the
> problem can't be reproduced.
>
> Add debug hooks in kernel shows, after 'date' command changes system time,
> around 150 seconds later, the chronyd process send 'clock_adjtime' syscalls
> down to kernel with txc mode 'ADJ_TICK | ADJ_FREQUENCY', then the time
> starts to go wrong.

> I know very little about chrony, and don't know in the above case that
> user set a big time jumping backwards, should we correct them with the
> NTP time received from time server, as when user choses to enable
> chrony it should trust and respect the time it provides?
>
> Or any suggestion how to hanle this? I read the /etc/chorny.conf and
> didn't find any option may help this. Many thanks!
>
> - Feng

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


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