-
-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows image has system time delay of 40 seconds #2792
Comments
would be very nice if this could be fixed |
@sabine Manaa Duration>>#seconds:nanoSeconds: seems like the 1 suspect with 2 while loops waiting for some magic to happen! That's where we lose those previous microseconds! |
and I attach a screenshot as "proof" |
so, it is 35 seconds and not 40. Still enough |
I know this does not solve your problem, but the ZTimestamp package contains an SNTP client that you can use to check/verify your local time against NTP time. See the class/method comments.
ZTimestampPreciseSNTPClient new clockDifference.
ZTimestampPreciseSNTPClient new
enforceClockDifference: 2 seconds
ifFail: [ :delta |
self inform: ('Clock difference {1} > 2s' format: { delta }) ];
close.
ZTimestampPreciseSNTPClient logClockDifferenceLargerThan: 1 second.
ZTimestampPreciseSNTPClient new remoteClock.
You could use this to warn you if the delta becomes too large.
… On 11 Mar 2019, at 13:51, Sabine ***@***.***> wrote:
I have the problem that on windows, Time now differs from the system time. At one instance, I have a difference of 40 seconds! (Pharo7) When searching for it, I found this: http://forum.world.st/System-time-td3486236.html
Starting a new image, there is no gap. The image with the 40 seconds gap is running since two weeks
the image is 40 seconds behind the windows system time.
I had a conversation with lamneth on discord and I copy it here:
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
From what can be read in the comments, seems like invoking the primitive 240 (and others) is not always a system call. Time seems to be managed by a heartbeat thread. From the source at: Comment for primitiveUTCMicrosecondClock (primitive 240) in the C code : /* Return the value of the microsecond clock in the local timezone, as |
Is your Windows Server installed on bare-metal or virtualized? |
It is virtualized, it is a Amazon EC2 instance |
Can you overlay the same graph with the clock difference generated from the shell.
You may find this interesting... |
I am running the similar test on my desktop...
World menu > System > Process Browser
|
@astares can you try with bens code please? I took a new pharo 7.0.2 image, loaded ZTimestamp s from the catalog and then started the code of ben. This is the result: (Array with: Time now with: (WinProcess resultOfCommand: 'time')) inspect also shows the same times I keep it running and come back with the result tomorrow. Then I know if the gap increases. I use eu-central |
Hi Sabine, see http://forum.world.st/Time-millisecondClockValue-was-The-Trunk-Morphic-mt-1080-mcz-tp4877661p4877918.html. IMO something like this still has to be implemented. |
My results, local Win10 desktop, |
Wrote a quick script (for Pharo 5.0) to collect timings. Will let it run for a few days.. I am on Windows 10.| delayTime oLatency oStr oTime iLatency iStr iTime pTime pStr target stream f fStream fName comma piDiff poDiff oSec iSec pSec | Gofer new ********************************************************************* " [[ "Pharo time" "OS time" "Internet time" "Write timing info to CSV file" (Delay forSeconds: delayTime) wait. |
Benoit, the following:
Won't do, this is way to inaccurate, it just takes too long the execute a subprocess or an HTTP call, there is a reason SNTP exists. |
But it should be way less, on my machine, it is less than 0.03 seconds, although it also went up a but over time, it also went down sometimes (I left one image open unattended for some time while working on other stuff on the same machine)
BTW, here is the result on a long running Linux image
|
Does it matter much as we're interested to see by how much the
*difference* grows over time (a few days)??
…On 2019-03-12 12:24, Sven Van Caekenberghe wrote:
Benoit, the following:
|"Get all different times we need" oLatency := Time millisecondsToRun:
[oStr := (WinProcess resultOfCommand: 'echo %date% %time%')]. iLatency
:= Time millisecondsToRun: [iStr := (ZnClient new url:
'http://worldtimeapi.org/') get]. pTime := DateAndTime now. |
Won't do, this is way to inaccurate, it just takes too long the
execute a subprocess or an HTTP call, there is a reason SNTP exists.
—
|
It lost the time also on the local windows 10 machine here from yesterday to today: see the screens below. I don't know why but the windows 10 machine had a difference of 38 seconds from the beginning. I was taking a complete fresh Pharo 7.0.2 . I wanted to make the same without the initial 38 seconds gap and started the new pharo image again on the windows 10 machine. When I started it again, there was no initial time difference and over time also NO gap. I dont understand this. Drives me crazy. I will now start new images on our servers in a regular interval so that the gap is not too big. e.g. I use cookies for login which are valid only for a short time and when the time difference gets too big, people can not log in. |
I want to bring this up again. A summary of the history of this thread is that on windows, the time of the Image (Time now) gets a gap to NTP Time which grows by several seconds each day. This has already be discussed here I start my production server images new each week since 6 months now because of this issue. And after a discussion at ESUG yesterday in the evening here again: yes, I could find ways for workarounds. But I think this is a serious issue which should be fixed because if you can not rely on the time in the image you can get various problems. I have put a link to this issue here pharo-project/pharo-vm#12 (did not know that it is a vm issue when reporting it 6 months ago). I really would appreciate having a good solution for this.
|
I've raised it as |
sth new here with the new vm? |
hi Sabine,
On Feb 4, 2021, at 12:59 AM, Sabine ***@***.***> wrote:
sth new here with the new vm?
the OpenSmalltalk-vm has moved to a newer higher resolution clock API on Windows, GetSystemTimePreciseAsFileTime, so the issue has been resolved in that source tree.
… —
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi Eliot, thank you for the fast answer! I am not following the details of the VM discussions, for this reason my simple question: is this the vm which will be delivered some day with Pharo? Or is this another vm tree? regards |
Hi Sabine,
On Feb 4, 2021, at 8:41 AM, Sabine ***@***.***> wrote:
hi Sabine,
On Feb 4, 2021, at 12:59 AM, Sabine @.***> wrote: sth new here with the new vm?
the OpenSmalltalk-vm has moved to a newer higher resolution clock API on Windows, GetSystemTimePreciseAsFileTime, so the issue has been resolved in that source tree.
…
Hi Eliot,
I am not following the details of the VM discussions, for this reason my simple question: is this the vm which will be delivered some day with Pharo? Or is this another vm tree?
The fix is in the original OpenSmalltalk-vm source tree, not the wonderfully democratic and truck-immune fork maintained by the Pharo community.
… regards
Sabine
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
thank you for the information, @eliotmiranda |
Hi @SabineMa I've been testing this for a couple weeks in Pharo9 with the lastest headless VM on Windows 10 (ARM64 using a Surface Pro X) and I have not seen any divergence in time between the system time and the one reported by Pharo (using This will be available in the upcoming Pharo 9 release. I'll close this issue for now, we can reopen it if necessary later. |
Hi Guille, sorry for coming bak so late now. We are not yet working with Pharo9. I will check it when we move to Pharo9. Thanks a lot for your work on this issue! |
I have the problem that on windows,
Time now
differs from the system time. At one instance, I have a difference of 40 seconds! (Pharo7) When searching for it, I found this: http://forum.world.st/System-time-td3486236.htmlStarting a new image, there is no gap. The image with the 40 seconds gap is running since two weeks
the image is 40 seconds behind the windows system time.
I had a conversation with lamneth on discord and I copy it here:
The text was updated successfully, but these errors were encountered: