5

I have a time sensitive operation that needs to be aware of clock skew among other computers, and /or guard against such a thing. How can I detect or guard against clock skew?

In my case I'm writing a compressed datetime stamp to Azure Blob. It would be disasterous if different nodes would intererpret that datetime stamp differently (as it can occur during a leap day, or leap second)


More info

I'm trying to detect clock skew in local node current time.

Each node will be writing time sensitive information to a Blob/Table. If the timestamp is older than X than certain actions will occur. If the time is not synchronized, data may be lost or corrupted.

Possible solution

Perhaps I can have each node write its current date to blob storage (32 bytes) on a regular interval, and then query that on a routine basis.

makerofthings7
  • 60,103
  • 53
  • 215
  • 448

1 Answers1

2

There are a few .NET NTP client APIs that will tell you the skew between a local node time and time on a NTP time server. For example:

You could use an NTP client to store both the local time and skew in your blob. When you read the blob on a different node, you could compute that node's local time and skew and compare it to the blob's stored time and skew.

artfulmethod
  • 631
  • 6
  • 7