You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mathias Weinert <ma...@gfa-net.de> on 2006/05/03 14:57:30 UTC

[PATCH] use WIN32_RETRY_LOOP also for cygwin

Hi there

In libsvn_subr/io.c there is macro called WIN32_RETRY_LOOP used to do
several retries of some file commands like rename. As the problem which
this macro shall solve - or at least soothe - also exists under cygwin
I would like this macro to also be used if under cygwin.

The following patch is just quick and dirty (indeed it's very dirty)
but it shows what I mean (and it works and helps).

Are there any objections against such a change (in principal)?

Mathias

--- subversion/libsvn_subr/io.c.orig    2005-11-17 00:05:43.000000000 +0100
+++ subversion/libsvn_subr/io.c 2006-05-03 16:31:00.062477500 +0200
@@ -71,7 +71,12 @@
   goes a long way towards minimizing it.  It is not an infinite
   loop because there might really be an error.
 */
-#ifdef WIN32
+#ifdef CYGWIN
+#define ERROR_ACCESS_DENIED 5L
+#define ERROR_SHARING_VIOLATION 32L
+#endif
+
+#if defined(WIN32) | defined(CYGWIN)
 #define WIN32_RETRY_LOOP(err, expr)                                        \
   do                                                                       \
     {                                                                      \

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

Re: [PATCH] use WIN32_RETRY_LOOP also for cygwin

Posted by "D.J. Heap" <dj...@gmail.com>.
On 5/3/06, Mathias Weinert <ma...@gfa-net.de> wrote:
> Hi there
>
> In libsvn_subr/io.c there is macro called WIN32_RETRY_LOOP used to do
> several retries of some file commands like rename. As the problem which
> this macro shall solve - or at least soothe - also exists under cygwin
> I would like this macro to also be used if under cygwin.
>
> The following patch is just quick and dirty (indeed it's very dirty)
> but it shows what I mean (and it works and helps).
>
> Are there any objections against such a change (in principal)?


I would like to see this applied -- I'm not setup to build or test it,
but I am reasonably certain it would reduce the occurance of failures
related to rename/delete/move on Windows.

In the last few weeks I've received 2 personal emails and seen 2 on
the users list (which I only skim once in a while) that so far appear
to be due to people using the cygwin version or an alternate working
copy implementation (JavaSVN?).

DJ

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


Re: [PATCH] use WIN32_RETRY_LOOP also for cygwin

Posted by "D.J. Heap" <dj...@gmail.com>.
On 5/4/06, Max Bowsher <ma...@ukf.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Mathias Weinert wrote:
> > Hi there
> >
> > In libsvn_subr/io.c there is macro called WIN32_RETRY_LOOP used to do
> > several retries of some file commands like rename. As the problem which
> > this macro shall solve - or at least soothe - also exists under cygwin
>
> It does?
>
> I realize this isn't something that is very easily reproducible, but
> could you give some suggestions how I might do that?
>
> Because I've been using Subversion on Cygwin for years, and have never
> experienced any errors which would encourage me to switch on
> WIN32_RETRY_LOOP - have I just been absurdly lucky?


How could it not?  At the end of the day cygwin is still calling the
same API's that the native version uses, isn't it?

To easily recreate it, try installing an aggressive on-access virus
scanner (which are required in lots of Windows shops, unfortunately). 
The problem is also much worse in a multiprocessor machine (because
tag-alongs can run faster or more concurrently, I suppose).

DJ

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


Re: [PATCH] use WIN32_RETRY_LOOP also for cygwin

Posted by Max Bowsher <ma...@ukf.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mathias Weinert wrote:
> Hi there
> 
> In libsvn_subr/io.c there is macro called WIN32_RETRY_LOOP used to do
> several retries of some file commands like rename. As the problem which
> this macro shall solve - or at least soothe - also exists under cygwin

It does?

I realize this isn't something that is very easily reproducible, but
could you give some suggestions how I might do that?

Because I've been using Subversion on Cygwin for years, and have never
experienced any errors which would encourage me to switch on
WIN32_RETRY_LOOP - have I just been absurdly lucky?


Also, __CYGWIN__ is the official preprocessor define to test for Cygwin.


Max.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iD8DBQFEWjCKfFNSmcDyxYARAjLhAJ9bBP1CWV6DENCruthKSy4xYWxsWgCcDzo9
Ef7K5Rpc8VBVx+u9XaEINHM=
=X/lR
-----END PGP SIGNATURE-----

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