0

I'm trying to develop a sync tool for Google contacts however I'm seeing some odd behavior.

In short, here's my problem:

I send request to modify a contact at time X.
The request will take X+1ms.
The entire process of snycing takes X+2ms.
I will update my timestamp at X+2ms.
For whatever reason the contact I modified shows an last modified time stamp of X+20ms and so gets sent back the other direction during the next sync. Bad.

The Google GData .NET Library I'm using is synchronous so it's not as if there are calls out in the ether that simply haven't finished.

Here's a pastebin of the request/response/and call times.

http://pastebin.com/Bw01S3C0

Any ideas?

RyanMac
  • 767
  • 1
  • 6
  • 18
  • Presumably the last modified time is being set on the *server* - so your idea of the time isn't terribly relevant. Or am I missing something? – Jon Skeet Feb 28 '13 at 19:18

2 Answers2

2

There is a little known first-order Special Relativistic effect that limits how closely synchronized multiple clocks can be at the Earth's surface. Two clocks can be synchrronized to each other exactly, but three or more cannot be synchronized more precisely than (if I recall the number correctly from 3rd year Physics) about 4 or 5 ms. While most Special Relativistic effects are 2nd or 3rd order in the speed of light c, this one is first order in c and thus easily detectable with modern hardware.

Pieter Geerkens
  • 11,775
  • 2
  • 32
  • 52
0

No, your not. It seems despite the fact I've consistently sync'd my system clocks to the same server, my VPS that's making these calls fell 20 seconds behind. Should've dawned on me earlier.

I noticed the headers for the responses were also 20 seconds ahead, so it wasn't specific to modified times.

Duh.

RyanMac
  • 767
  • 1
  • 6
  • 18