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

Deleting trouble

From: Lübbe Onken <l.onken_at_rac.de>
Date: 2003-12-12 10:22:18 CET

Hi Folks,

a while ago I encountered the above mentioned problem, when working with
TortoiseSVN under Win2K. Before anybody shouts "This is the Subversion
developer list", yes, I know and that's why I am posting it here. Stefan
and I spent some time investigating the problem and came to the
conclusion that the problem is caused by the subversion libs leaking
file handles.

Try the following recipe under Win2K. You have to have TortoiseSVN
installed.

1) Do a fresh Checkout (using cl client or TortoiseSVN) into c:\foobar
2) modify a file inside c:\foobar, do *not* commit your changes
3) hit <f5> in Windows explorer to refresh the status overlay
4) try to delete c:\foobar using windows explorer
5) you will get an error like "c:\foobar\.svn\tmp is in use by another
process" (roughly translated from german)

We think, that this is caused by the subversion libraries leaking file
handles (especially .\svn\tmp). A quote from Stefan:

> The problem here is that explorer keeps the TSVN shell
> extension in memory, and the subversion command line
> client exits completely after every command. And windows
> automatically closes all still open handles a program created
> after it exits - so you won't notice that problem with the
> cl client...

I tried to lock down the problem using SysInternal's file monitor and
process explorer.

Attachement 1 contains a short log of what File monitor shows, when svn
st -v is run on the directory containing just a single modified file.

Notice, that there are a "TextDatei.pas.tmp" and a
"TextDatei.pas.tmp.tmp" created.
Then it looks like "TextDatei.pas.tmp.tmp" is renamed (to
"TextDatei.pas.tmp" ?!?) and then
"TextDatei.pas.tmp" is closed twice.
I think (cannot prove) that this sequence leaves a handle open.

The same sequence happens (more often) when the windows explorer, using
the TortoiseSVN shell integration, using the subversion libraries tries
to fetch the status. Only in this case the file handle is left open,
because the explorer process doesn't terminate.

A check with Process explorer shows, that explorer.exe has tons of
"*\.svn\tmp" file handles open at any time.

I hope that someone with deeper knowledge of the svn libs can
investigate further and maybe find a solution.
This only happens, when the working copy to delete contains uncommitted
changes, but it's a real blocker.

Cheers & thanks
-Lübbe

1 09:52:54 svn.exe:832 CREATE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS Options: Create Access: All
2 09:52:54 svn.exe:832 CLOSE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS
3 09:52:54 svn.exe:832 CREATE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp.tmp SUCCESS Options: Create Access: All
4 09:52:54 svn.exe:832 WRITE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp.tmp SUCCESS Offset: 0 Length: 6
5 09:52:54 svn.exe:832 CLOSE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp.tmp SUCCESS
6 09:52:54 svn.exe:832 OPEN D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp.tmp SUCCESS Options: Open Access: All
7 09:52:54 svn.exe:832 OPEN D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS Options: Open Access: All
8 09:52:54 svn.exe:832 SET INFORMATION D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp.tmp SUCCESS FileRenameInformation
9 09:52:54 svn.exe:832 CLOSE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS
10 09:52:54 svn.exe:832 CLOSE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS
11 09:52:54 svn.exe:832 OPEN D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS Options: Open Access: All
12 09:52:54 svn.exe:832 CLOSE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS
13 09:52:54 svn.exe:832 QUERY INFORMATION D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS Attributes: A
14 09:52:54 svn.exe:832 OPEN D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS Options: Open Access: All
15 09:52:54 svn.exe:832 SET INFORMATION D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS FileBasicInformation
16 09:52:54 svn.exe:832 CLOSE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS
17 09:52:54 svn.exe:832 OPEN D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS Options: Open Access: All
18 09:52:54 svn.exe:832 DELETE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS
19 09:52:54 svn.exe:832 CLOSE D:\TESTPR~1\b\.svn\tmp\TextDatei.pas.tmp SUCCESS

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 12 10:23:04 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.