Page MenuHomeSoftware Heritage

svn: Wraps commit info retrieval in a retryable SvnRepo method
ClosedPublic

Authored by anlambert on May 20 2022, 4:11 PM.

Details

Summary

Temporary network failures can also happen when using subversion
remote access API so make single commit info retrieval operation
retryable.

Fixes SWH-LOADER-SVN-6T.

Diff Detail

Repository
rDLDSVN Subversion (SVN) loader
Branch
svn-commit-info
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 29667
Build 46362: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 46361: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D7878 (id=28430)

Rebasing onto 2afad0ee23...

Current branch diff-target is up to date.
Changes applied before test
commit 3bae2b64d17bbbb1b8166666396f1b399f2f0cdf
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri May 20 16:07:16 2022 +0200

    svn: Wraps commit info retrieval in a retryable SvnRepo method
    
    Temporary network failures can also happen when using subversion
    remote access API so make single commit info retrieval operation
    retryable.

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

ardumont added a subscriber: ardumont.

lgtm, one suggestion inline.

swh/loader/svn/svn.py
225

self.logs is an iterator, so that will cost less that way ^.

(that must also need a try...except StopIteration).

This revision is now accepted and ready to land.May 20 2022, 5:29 PM
swh/loader/svn/svn.py
225

Better like this, indeed.

Instead of adding a try block, I used the default parameter of next.

Build is green

Patch application report for D7878 (id=28584)

Rebasing onto 2afad0ee23...

Current branch diff-target is up to date.
Changes applied before test
commit 670365596e4a12d7b20246399e549bc4e7bf728a
Author: Antoine Lambert <anlambert@softwareheritage.org>
Date:   Fri May 20 16:07:16 2022 +0200

    svn: Wraps commit info retrieval in a retryable SvnRepo method
    
    Temporary network failures can also happen when using subversion
    remote access API so make single commit info retrieval operation
    retryable.

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

swh/loader/svn/svn.py
226

Does the next(..., None) avoids the try .. except stanza?
if so, til and neat!

226

lol, yeah you answered it already ¯\_(ツ)_/¯ (sorry for the noise ;)

swh/loader/svn/svn.py
226

Yes, it is exactly the purpose of that parameter: return a default value when there is nothing to iterate.