Sorry about that. Sleep shortened to 1ns, also.
Log:
Windows rename (MoveFileEx) operations will sometimes fail with
'Access Denied' when it should not -- it appears to be a race/bug
in MoveFileEx or NTFS somewhere. A short sleep and retrying the
operation finishes correctly. See the dev archives for more
information (search for MoveFileEx and/or Access Denied).
* subversion/libsvn_subr/io.c
(svn_io_file_rename): Add a short sleep and retry if the rename
fails in Windows with 'Access Denied.'
Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 6059)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -1445,6 +1445,20 @@
status = apr_file_rename (from_path_apr, to_path_apr, pool);
+#ifdef SVN_WIN32
+ /* Due to an apparent bug in Windows, sometimes 'access denied' will be
+ returned when it should not be -- a short sleep (1ns) and retrying
+ correctly finishes the operation. See the dev mailing list archives
+ for extensive discussion and further details (search for MoveFileEx
+ and/or 'Access Denied'). */
+
+ if (status && APR_TO_OS_ERROR (status) == ERROR_ACCESS_DENIED)
+ {
+ apr_sleep (1);
+ 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 Wed May 28 00:57:42 2003