Page MenuHomeSoftware Heritage

svn: Prefer to svn cleanup path instead of removing it before checkout
ClosedPublic

Authored by anlambert on Apr 12 2022, 4:21 PM.

Details

Summary

In production, we have errors reporting that path is already locked or that
the working copy cannot be locked when attempting to perform a checkout
operation.

For some reasons, it seems that attempting to remove the checkout path before
that operation is not sufficient for some cases.

So prefer to svn cleanup the working copy to ensure remaining locks will be
removed, checkout operation can then be safely retried.

Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from subvertpy import SubversionException, client, properties
>>> from subvertpy.ra import Auth, RemoteAccess, get_username_provider
>>> auth = Auth([get_username_provider()])
>>> client = client.Client(auth=auth)
>>> client.checkout("http://svn.code.sf.net/p/tacklebar/tacklebar", "toto", 356)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
subvertpy.SubversionException: ("Working copy '/tmp/toto' locked.", 155004)
>>> from subvertpy import wc
>>> wc.cleanup("toto")
>>> client.checkout("http://svn.code.sf.net/p/tacklebar/tacklebar", "toto", 356)
>>>

Should fix errors of type <path> is already locked via <path> and Failed to lock working copy <path>
in SWH-LOADER-SVN-7C.

Diff Detail

Repository
rDLDSVN Subversion (SVN) loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D7557 (id=27397)

Rebasing onto 7e06f33f5c...

Current branch diff-target is up to date.
Changes applied before test
commit 2f1d9c23f783e4032f6416d313a7e6a271af2ad3
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Tue Apr 12 16:05:25 2022 +0200

    svn: Prefer to svn cleanup path instead of removing it before checkout
    
    In production, we have errors reporting that path is already locked or that
    the working copy cannot be locked when attempting to perform a checkout
    operation.
    
    For some reasons, it seems that attempting to remove the checkout path before
    that operation is not sufficient for some cases.
    
    So prefer to svn cleanup the working copy to ensure remaining locks will be
    removed, checkout operation can then be safely retried.

See https://jenkins.softwareheritage.org/job/DLDSVN/job/tests-on-diff/313/ for more details.

This revision is now accepted and ready to land.Apr 13 2022, 11:42 AM