You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by solo turn <so...@yahoo.com> on 2004/01/14 13:54:21 UTC

svn 0.34.0, 0.35.1 windows access is denied on delete directory

the following error occured when doing "svn up" on a big working copy:

U  com\utils\ResourceBundle.java
svn: Problem on first log entry in a working copy
svn: In directory 'com/xml'
svn: Error processing command 'delete-entry' in 'com/xml'
svn: Access is denied.
svn: svn_io_remove_dir: removing 'com/xml/datainterchange/.svn'

datainterchange is a directory. a whole subtree got deleted there. here the error occurs just on
directory delete. the next run deletes datainterchange, but fails with the same error on WEB-INF.

could it be there is still a problem remaining?

server version: 0.31.0
client version: 0.34.0, 0.35.1



__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn 0.34.0, 0.35.1 windows access is denied on delete directory

Posted by Branko Čibej <br...@xbc.nu>.
Philip Martin wrote:

>"D.J. Heap" <dj...@shadyvale.net> writes:
>
>  
>
>>it *is* kind of an ugly preprocessor macro
>>    
>>
>
>That was my initial reaction, but after reading the patch I think it's
>cleaner than the existing code.  I'll approve it for the trunk.
>
And I. We can clean up the mess some other time; at least this sweeps it
under the carpet. :-)


-- 
Brane Čibej   <br...@xbc.nu>   http://www.xbc.nu/brane/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn 0.34.0, 0.35.1 windows access is denied on delete directory

Posted by Philip Martin <ph...@codematters.co.uk>.
"D.J. Heap" <dj...@shadyvale.net> writes:

> it *is* kind of an ugly preprocessor macro

That was my initial reaction, but after reading the patch I think it's
cleaner than the existing code.  I'll approve it for the trunk.  I
suggest you propose it in the STATUS file for 1.0-branch, I don't
think we want 1.0 to produce 'access denied' errors.

> Log:
>
> Factor the Window's retry loops into a macro and add the loops to
> a couple of more places where 'access denied' errors have been
> reported.

That duplicates too much of the text below, just say something like:
  Fix some more 'access denied' errors on Windows.

>
> * subversion\libsvn_subr\io.c

Use / rather than \ to match the other log messages.

>    (svn_io_file_rename, svn_io_remove_file, svn_io_remove_dir,
>     svn_io_dir_remove_nonrecursive):  Factor out the Windows
>     retry loop into a macro and add it to the directory
>     removal functions.

Add something like:
     (WIN32_RETRY_LOOP): New macro.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn 0.34.0, 0.35.1 windows access is denied on delete directory

Posted by "D.J. Heap" <dj...@shadyvale.net>.
Philip Martin wrote:
[snip]

I was able to get your patch working with a bit of tweaking, but I ran 
into some warnings and as I was tinkering I came up with this patch and 
thought I'd run it past you and see if it's acceptable -- it folds all 
of the loops into one preprocessor macro, but it *is* kind of an ugly 
preprocessor macro, which may not be acceptable...?  On Windows it 
compiles and runs and solves the 'access denied' problems that I am able 
to recreate with our A/V software.

Log:

Factor the Window's retry loops into a macro and add the loops to
a couple of more places where 'access denied' errors have been
reported.

* subversion\libsvn_subr\io.c
   (svn_io_file_rename, svn_io_remove_file, svn_io_remove_dir,
    svn_io_dir_remove_nonrecursive):  Factor out the Windows
    retry loop into a macro and add it to the directory
    removal functions.


Re: svn 0.34.0, 0.35.1 windows access is denied on delete directory

Posted by Philip Martin <ph...@codematters.co.uk>.
Philip Martin <ph...@codematters.co.uk> writes:

> solo turn <so...@yahoo.com> writes:
>
>> U  com\utils\ResourceBundle.java
>> svn: Problem on first log entry in a working copy
>> svn: In directory 'com/xml'
>> svn: Error processing command 'delete-entry' in 'com/xml'
>> svn: Access is denied.
>> svn: svn_io_remove_dir: removing 'com/xml/datainterchange/.svn'
>>
>> could it be there is still a problem remaining?
>
> I don't think anything has changed since the last time this was
> reported.  It appears that apr_dir_remove in svn_io_remove_dir needs a
> loop similar to the one around apr_file_remove in svn_io_remove_file.
> It doesn't look hard, bonus points are available for factoring the
> loop into some common code.

This may not compile as I don't have a Windows machine.  Perhaps
someone who does would: a) compile it, b) reproduce the original
problem, and c) confirm whether this fixes it.

Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c	(revision 8319)
+++ subversion/libsvn_subr/io.c	(working copy)
@@ -972,6 +972,50 @@
 
 /* Deletion. */
 
+/* Call DELETE_FN(PATH,POOL) to delete PATH and jump through platform
+ * specific hoops to make it work.  PATH should be in native encoding and
+ * DELETE_FN should be either apr_file_remove or apr_dir_remove.  The
+ * caller is resposible for making the file/directory decision.
+ */
+static apr_status_t
+delete_path (apr_status_t (*delete_fn)(const char *, apr_pool_t *),
+             const char *path, 
+             apr_pool_t *pool)
+{
+  apr_status_t apr_err = delete_fn (path, pool);
+
+#ifdef WIN32
+  /*
+    Windows is 'aided' by a number of types of applications that
+    follow other applications around and open up files they have
+    changed for various reasons (the most intrusive are virus
+    scanners).  So, if one of these other apps has glommed onto
+    one of our files we may get an 'access denied' error.
+    
+    This retry loop does not completely solve the problem (who
+    knows how long the other app is going to hold onto the file), but
+    goes a long way towards minimizing it.  It is not an infinite
+    loop because there might really be an error.
+  */
+  {
+    int retries = 0;
+    int sleep_count = 1000;
+
+    for ( retries = 0;
+          APR_TO_OS_ERROR (apr_err) == ERROR_ACCESS_DENIED && retries < 100;
+          ++retries )
+      {
+        apr_sleep (sleep_count);
+        if (sleep_count < 128000)
+          sleep_count *= 2;
+        apr_err = delete_fn (path, pool);
+      }
+  }
+#endif /* WIN32 */
+
+  return apr_err;
+}
+
 svn_error_t *
 svn_io_remove_file (const char *path, apr_pool_t *pool)
 {
@@ -997,37 +1041,7 @@
 
   SVN_ERR (svn_path_cstring_from_utf8 (&path_apr, path, pool));
 
-  apr_err = apr_file_remove (path_apr, pool);
-
-#ifdef WIN32
-  /*
-    Windows is 'aided' by a number of types of applications that
-    follow other applications around and open up files they have
-    changed for various reasons (the most intrusive are virus
-    scanners).  So, if one of these other apps has glommed onto
-    our file we may get an 'access denied' error.
-    
-    This retry loop does not completely solve the problem (who
-    knows how long the other app is going to hold onto it for), but
-    goes a long way towards minimizing it.  It is not an infinite
-    loop because there might really be an error.
-  */
-  {
-    int retries = 0;
-    int sleep_count = 1000;
-
-    for ( retries = 0;
-          APR_TO_OS_ERROR (apr_err) == ERROR_ACCESS_DENIED && retries < 100;
-          ++retries )
-    {
-      apr_sleep (sleep_count);
-      if (sleep_count < 128000)
-        sleep_count *= 2;
-      apr_err = apr_file_remove (path_apr, pool);
-    }
-  }
-#endif /* WIN32 */
-
+  apr_err = delete_path (apr_file_remove, path_apr, pool);
   if (apr_err)
     return svn_error_wrap_apr (apr_err, "Can't remove file '%s'", path);
 
@@ -1108,7 +1122,7 @@
   if (status)
     return svn_error_wrap_apr (status, "Error closing directory '%s'", path);
 
-  status = apr_dir_remove (path_apr, subpool);
+  status = delete_path (apr_dir_remove, path_apr, subpool);
   if (status)
     return svn_error_wrap_apr (status, "Can't remove '%s'", path);
 

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn 0.34.0, 0.35.1 windows access is denied on delete directory

Posted by Philip Martin <ph...@codematters.co.uk>.
solo turn <so...@yahoo.com> writes:

> U  com\utils\ResourceBundle.java
> svn: Problem on first log entry in a working copy
> svn: In directory 'com/xml'
> svn: Error processing command 'delete-entry' in 'com/xml'
> svn: Access is denied.
> svn: svn_io_remove_dir: removing 'com/xml/datainterchange/.svn'
>
> could it be there is still a problem remaining?

I don't think anything has changed since the last time this was
reported.  It appears that apr_dir_remove in svn_io_remove_dir needs a
loop similar to the one around apr_file_remove in svn_io_remove_file.
It doesn't look hard, bonus points are available for factoring the
loop into some common code.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org