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

Re: svn_io_file_rename error during add

From: D.J. Heap <dj_at_shadyvale.net>
Date: 2003-07-18 07:49:49 CEST

Philip Martin wrote:
> "Steve Williams" <stevewilliams@kromestudios.com> writes:
>

[snip]

>
>>This is an intermittent issue. I reverted the whole Props folder tree and
>>the 'svn add Props' command worked fine after that.
>
>
> Subversion appears to trigger a race condition somewhere in the
> Windows filesystem. We don't really have a solution.
>

I've resorted to using this little perversion until something better is
found -- and it still doesn't help some of the tests where a newly
created directory cannot be chdir'd into occasionally. But this has
kept us working at least.

I'm going to take another half a day or so this weekend and try to
reproduce it outside of Subversion. Or perhaps study the APR file API
more so I understand better how it's interacting with Win32. Just using
the APR file calls in a similar manner to Subversion's usage has not
yielded any failures yet in my repro attempts -- there's something
unique about Subversion and the tests that I'm missing in the repro
programs.

DJ

Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 6504)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -847,6 +847,19 @@
 
   apr_err = apr_file_remove (path_apr, pool);
 
+#ifdef SVN_WIN32
+ {
+ int retries = 0;
+ for ( retries = 0;
+ retries < 100 && apr_err && APR_TO_OS_ERROR(apr_err) == ERROR_ACCESS_DENIED;
+ ++retries )
+ {
+ apr_sleep(1000);
+ apr_err = apr_file_remove( path_apr, pool );
+ }
+ }
+#endif
+
   if (apr_err)
     return svn_error_createf
       (apr_err, NULL,
@@ -1474,6 +1487,19 @@
 
   status = apr_file_rename (from_path_apr, to_path_apr, pool);
 
+#ifdef SVN_WIN32
+ {
+ int retries = 0;
+ for ( retries = 0;
+ retries < 100 && status && APR_TO_OS_ERROR(status) == ERROR_ACCESS_DENIED;
+ ++retries )
+ {
+ apr_sleep(1000);
+ status = apr_file_rename( from_path_apr, to_path_apr, pool );
+ }
+ }
+#endif
+
   if (status)
     return svn_error_createf (status, NULL,
                               "svn_io_file_rename: can't move '%s' to '%s'",

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jul 18 07:52:00 2003

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.