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

RE: [TSVN] TSVNCache and renaming .svn/entries

From: Alexander Kitaev <alex_at_tmate.org>
Date: 2005-09-19 20:14:38 CEST

> of time. But AFAIK, that function only opens the files with
> SHARE_READ access, so you should be at least able to read those files.
Yes, I could read the file, but in that very operation I have to make an
atomic rename (i.e. replace opened file) and this operation fails.

> I'd suggest you try the same approach as Subversion: open the
> file. If it fails (because another process has the file open)
> wait a little while, then try again. Subversion tries to open
> its files 200 times before it gives up.
Thanks for the hint Stefan, I found WIN32_RETRY_LOOP in Subversion sources
and will use the same approach in JavaSVN.

> Another thing: please, if you write a message to this list,
> don't just reply to another message! That messes up the
> message threads. And at least, don't quote that message
> you're replying to!! The message you replied to has
> absolutely *nothing* to do with what you just wrote, and
> there's absolutely *no* need to quote that mail.
I regret on making this mistake, I usually make correct posts, but this time
forgot to delete the letter I made reply to (not to retype mailing list
address). Excuse me for inconvenience and thanks again for a great hint
you've suggested!

Alexander Kitaev,
TMate Software,
http://tmatesoft.com/
http://tmate.org/

> -----Original Message-----
> From: Stefan Kung [mailto:tortoisesvn@gmail.com]
> Sent: Monday, September 19, 2005 19:57
> To: dev@tortoisesvn.tigris.org
> Cc: alex@tmate.org
> Subject: Re: [TSVN] TSVNCache and renaming .svn/entries
>
> Alexander Kitaev wrote:
>
> > I'm working on the pure Java Subversion client library (JavaSVN).
> > Recently one of the users reported an exception that states that
> > JavaSVN was not able to rename .svn/tmp/entries to .svn/entries.
> >
> > This rename operation is performed every time "entries"
> file is saved
> > and same approach with temorary file is used in the command line
> > Subversion client. First contents is saved to .svn/tmp/entries and
> > then .svn/tmp/entries is atomically renamed to .svn/entries. AFAIU,
> > this may fail in case .svn/entries is locked by some other program
> > that reads from that file or writes to it.
> >
> > User reported that he runs TortoiseSVN and has
> TSVNCache.exe program
> > running and I think that ot could lock "entries" file and
> thus prevent renaming.
> > User's application performs addition of several thousands files and
> > problem is hardly reproducable, but sometimes it appears.
> User's OS is Windows XP.
> >
> > User's version of TSVN is 1.2.1, build 3895. The latest version
> > available is 1.2.2, build 4295. What I would like to ask is whether
> > upgrading to the newer version could solve that problem or should I
> > instead modify JavaSVN to handle failed renames (i.e. wait
> for 100ms
> > and try to rename the file again)?
>
> TSVN (and TSVNCache) doesn't lock those files itself. It uses
> the Subversion library for calls to svn_client_status2() -
> and that function can 'lock' those files for a short period
> of time. But AFAIK, that function only opens the files with
> SHARE_READ access, so you should be at least able to read those files.
> Another issue might be a running virus scanner. We've known
> this kind of problem for a long time now: some virus scanners
> lock Subversions own files and then Subversion operations can
> fail because of locked files.
>
> I'd suggest you try the same approach as Subversion: open the
> file. If it fails (because another process has the file open)
> wait a little while, then try again. Subversion tries to open
> its files 200 times before it gives up.
>
> Another thing: please, if you write a message to this list,
> don't just reply to another message! That messes up the
> message threads. And at least, don't quote that message
> you're replying to!! The message you replied to has
> absolutely *nothing* to do with what you just wrote, and
> there's absolutely *no* need to quote that mail.
>
> Stefan
>
> --
> ___
> oo // \\ "De Chelonian Mobile"
> (_,\/ \_/ \ TortoiseSVN
> \ \_/_\_/> The coolest Interface to (Sub)Version Control
> /_/ \_\ http://tortoisesvn.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Mon Sep 19 20:16:22 2005

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.