mozilla / makedrive

[RETIRED] Webmaker Filesystem
Mozilla Public License 2.0
351 stars 33 forks source link

Make modified times more reliable #447

Open gideonthomas opened 9 years ago

gideonthomas commented 9 years ago

In rsync, we use the node modified time in several places, sometimes even for comparisons. However, it is unreliable as different clients can be in different time zones. We need to make modified times more reliable.

One way to do this is by adding a wrapper to the fs that will lie in the middle of the current fs wrapper and the core fs. We can put a default time to use which will be UTC and allow the client to provide a time difference relative to UTC. Then, whenever we want to use modified time on the server, we use UTC, on the client we use the normal modified time (whatever fs core adds), while when we do comparisons, we convert the modified time to UTC by using what the client provides so that we can compare UTC with UTC times.

cc @humphd

gideonthomas commented 9 years ago

also to consider: our code might break if the NOMTIME flag is set for the filesystem.

humphd commented 9 years ago

The problem is harder than this, I think, since you can't rely on the clocks in a client being accurate to each other. I can have my clock set fast, you slow, and we're toast. You'd need talk to a time server, and even then it's probably hard to get right.

Relying on times at all is problematic imho.

alicoding commented 9 years ago

I've extended this milestone till end of this week.