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

Re: [repost] SVN commit error: svn_io_file_rename: can't move

From: D.J. Heap <djheap_at_dhiprovo.com>
Date: 2003-09-29 19:07:27 CEST

James Van Artsdalen wrote:
> One of my test systems isn't running any virus or indexing software
> or any other filesystem walker that I know of.
>
> http://www.sysinternals.com/ has a free FileMon program that is a
> sort of poor man's ktrace. It might be able to catch the bug in the act.
>
> Can you point me to the patch or the line in SVN's source code of
> interest? I have a repeatable test case; perhaps I can instrument it and
> learn something.
>

The Windows 'access denied' problem is not limited to commits -- I've
seen it on Checkouts, Updates, Merges, etc -- basically anything that
touches the admin directory. The other problem you posted about 'txn
already exists' looks like it is a different problem and not related (it
is server-side, while the 'access denied' is during post-commit
client-side updating).

As far as I am aware, the 'access denied' problem only affects the
rename and remove functions. The patch I've been using to work around
it is attached. However, even with this patch we've had problems when
virus scanning is on (100 retries still fails).

I'd be very happy if you can supply a script to reliably reproduce it on
different machines -- it seems to vary widely with machine speed. Or if
you find any patterns or info from tracing. I've spent an inordinate
amount of time trying to reproduce it outside of Subversion so I can get
a bug issue going with MS, but I've not yet succeeded and don't have a
lot of time to work on it.

DJ

**********************************************************************
This email and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom they are addressed. If you have received this email
in error please notify the system manager.

This footnote also confirms that this email message has been
swept by MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 7238)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -851,6 +851,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,
@@ -1483,6 +1496,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 Mon Sep 29 19:08:45 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.