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

Re: [ISSUE] Cancelling svn checkout leaves an open file handle

From: Uroš Jovanović <urosh3d_at_gmail.com>
Date: Wed, 9 Sep 2020 11:19:02 +0200

>
> Do you know if SharpSvn is maintained? When I checked your previous test
> code it seemed the NuGet package of SharpSvn is based on Subversion 1.9 and
> any bugfix will (at maximum) be applied to 1.10 and 1.14. So maybe you are
> out of luck even if we find it is a bug in Subversion and fix it.

I glanced through their forums, they have plans on updating, but obviously
with no hurry since the last nuget was published in 2017.

Regarding test cases I suppose these should be plain C to make sure they
> are executable on any platform.
>

Unfortunately, I don't think I'll manage to provide the test case in plain
C but I hope the link I provided can help you with Win API.

Will there be a Jira issue made, so there is a way to monitor the status?

If you need any further assistance, please let me know.

Regards,
Uros

On Wed, Sep 9, 2020 at 10:48 AM Daniel Sahlberg <daniel.l.sahlberg_at_gmail.com>
wrote:

> Den ons 9 sep. 2020 kl 10:38 skrev Uroš Jovanović <urosh3d_at_gmail.com>:
>
>> Hi Nathan,
>> Hi Daniel,
>>
>> Thank you both for your replies.
>>
>> As a workaround I ended up doing exactly the things you mentioned. After
>> the cancellation of the operation I call additional code to "cleanup".
>> This code goes through open file handles held by the current process and
>> closes the ones left over in .svn\tmp.
>>
>> That being said, I don't know how easy/hard this is to do on Linux, but
>> doing this kind of stuff on Windows is a giant pain in the a**.
>> It involves calling a bunch of poorly documented, low-level native
>> methods from Windows' internal api.
>>
>> Luckily, I found some code online and modified it in order to work on
>> both 32 and 64 bit apps.
>> For reference, you can find this code on my github
>> <https://github.com/urosjovanovic/MceController/blob/master/VmcServices/DetectOpenFiles.cs>
>> .
>>
>
> GREAT, you just saved me a couple of hours of work to dig up the APIs.
>
>
>>
>> So the final process is as follows:
>>
>> 1. Perform checkout
>> 2. Cancel checkout
>> 3. If present, force-close the open file handle in .svn\tmp
>> 4. Perform a regular svn cleanup to break locks etc.
>>
>> It works, but now I have an additional ~700 LOC to maintain just in order
>> to detect and close those rogue file handles, hoping it will not crash the
>> app. :)
>>
>> If you want, I can provide a test case written in C# using SharpSvn which
>> will work exactly as Daniel wrote, but on Windows.
>> I can also use the repo of your choice, if you have a preferred one for
>> testing.
>>
>
> Do you know if SharpSvn is maintained? When I checked your previous test
> code it seemed the NuGet package of SharpSvn is based on Subversion 1.9 and
> any bugfix will (at maximum) be applied to 1.10 and 1.14. So maybe you are
> out of luck even if we find it is a bug in Subversion and fix it.
>
> Regarding test cases I suppose these should be plain C to make sure they
> are executable on any platform.
>
> Daniel
>
>>
Received on 2020-09-09 12:48:31 CEST

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.