[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: trivial yet very serious bug, suggestions welcome

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2001-10-30 00:49:44 CET

> This is only client-side -- server times don't affect this issue.

I think you misunderstood. The Subversion server isn't at issue here,
but a file server might be.

The lesson here is not to use the current system time when you're
playing with timestamps. For instance, if you want to decrement the
mod time by one second, use stat() after closing the file to find the
basis, not time(). Some deal if you just want to record the mod time
of a file you just wrote out.

Arguably, this means CVS is not correct when it uses time() to
determine if 1s has already passed since the last time it wrote out a
file. In a high-speed situation, you could imagine the following
occuring:

  1. A second ticks by on the client
  2. A second ticks by on the file server
  3. Client writes out a file
  4. Another second ticks by on the client
  5. The client checks the time, determines that a second has passed
     since the file was written, and doesn't do the sleep(1) before
     exiting.
  6. The file is modified, but is assigned the same mod time by the
     file server since it's still the same second over there.
  7. Another second ticks by on the server.

So, maybe we should just always sleep(1) if we recorded any
timestamps whatsoever.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:46 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.