subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svn-r...@apache.org
Subject svn commit: r1582588 - in /subversion/branches/1.8.x: ./ STATUS subversion/include/private/svn_dep_compat.h subversion/libsvn_subr/io.c
Date Fri, 28 Mar 2014 04:01:00 GMT
Author: svn-role
Date: Fri Mar 28 04:00:59 2014
New Revision: 1582588

URL: http://svn.apache.org/r1582588
Log:
Merge the 1.8.x-r1581305 branch:

 * r1581305, r1581315
   Increase timestamp sleep from 1ms to 10ms for hi-res filesystems.
   Justification:
     Missed text changes on some Linux systems.
   Branch:
     ^/subversion/branches/1.8.x-r1581305
   Votes:
     +1: philip, rhuijben, ivan

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/include/private/svn_dep_compat.h
    subversion/branches/1.8.x/subversion/libsvn_subr/io.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1581305,1581315
  Merged /subversion/branches/1.8.x-r1581305:r1581320-1582587

Modified: subversion/branches/1.8.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1582588&r1=1582587&r2=1582588&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Fri Mar 28 04:00:59 2014
@@ -323,15 +323,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1581305, r1581315
-   Increase timestamp sleep from 1ms to 10ms for hi-res filesystems.
-   Justification:
-     Missed text changes on some Linux systems.
-   Branch:
-     ^/subversion/branches/1.8.x-r1581305
-   Votes:
-     +1: philip, rhuijben, ivan
-
  * r1555403
    Update copyright years in NOTICE and subversion/libsvn_subr/version.c.
    Justification:

Modified: subversion/branches/1.8.x/subversion/include/private/svn_dep_compat.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/include/private/svn_dep_compat.h?rev=1582588&r1=1582587&r2=1582588&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/include/private/svn_dep_compat.h (original)
+++ subversion/branches/1.8.x/subversion/include/private/svn_dep_compat.h Fri Mar 28 04:00:59
2014
@@ -114,6 +114,12 @@ typedef apr_uint32_t apr_uintptr_t;
 #define SVN_LOCK_IS_BUSY(x) APR_STATUS_IS_EBUSY(x)
 #endif
 
+#if !APR_VERSION_AT_LEAST(1,4,0)
+#ifndef apr_time_from_msec
+#define apr_time_from_msec(msec) ((apr_time_t)(msec) * 1000)
+#endif
+#endif
+
 /**
  * Check at compile time if the Serf version is at least a certain
  * level.

Modified: subversion/branches/1.8.x/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/libsvn_subr/io.c?rev=1582588&r1=1582587&r2=1582588&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/1.8.x/subversion/libsvn_subr/io.c Fri Mar 28 04:00:59 2014
@@ -1243,32 +1243,44 @@ svn_io_sleep_for_timestamps(const char *
         {
           /* Very simplistic but safe approach:
               If the filesystem has < sec mtime we can be reasonably sure
-              that the filesystem has <= millisecond precision.
+              that the filesystem has some sub-second resolution.  On Windows
+              it is likely to be sub-millisecond; on Linux systems it depends
+              on the filesystem, ext4 is typically 1ms, 4ms or 10ms resolution.
 
              ## Perhaps find a better algorithm here. This will fail once
-                in every 1000 cases on a millisecond precision filesystem.
+                in every 1000 cases on a millisecond precision filesystem
+                if the mtime happens to be an exact second.
 
                 But better to fail once in every thousand cases than every
                 time, like we did before.
-                (All tested filesystems I know have at least microsecond precision.)
 
              Note for further research on algorithm:
-               FAT32 has < 1 sec precision on ctime, but 2 sec on mtime */
+               FAT32 has < 1 sec precision on ctime, but 2 sec on mtime.
 
-          /* Sleep for at least 1 millisecond.
-             (t < 1000 will be round to 0 in apr) */
-          apr_sleep(1000);
+               Linux/ext4 with CONFIG_HZ=250 has high resolution
+               apr_time_now and although the filesystem timestamps
+               have similar high precision they are only updated with
+               a coarser 4ms resolution. */
 
-          return;
+          /* 10 milliseconds after now. */
+#ifndef SVN_HI_RES_SLEEP_MS
+#define SVN_HI_RES_SLEEP_MS 10
+#endif
+          then = now + apr_time_from_msec(SVN_HI_RES_SLEEP_MS);
         }
 
-      now = apr_time_now(); /* Extract the time used for the path stat */
-
-      if (now >= then)
-        return; /* Passing negative values may suspend indefinitely (Windows) */
+      /* Remove time taken to do stat() from sleep. */
+      now = apr_time_now();
     }
 
-  apr_sleep(then - now);
+  if (now >= then)
+    return; /* Passing negative values may suspend indefinitely (Windows) */
+
+  /* (t < 1000 will be round to 0 in apr) */
+  if (then - now < 1000)
+    apr_sleep(1000);
+  else
+    apr_sleep(then - now);
 }
 
 



Mime
View raw message