Page MenuHomeSoftware Heritage

Make BaseIndexer.catch_exception=False actually re-raise exceptions instead of silencing them.
ClosedPublic

Authored by vlorentz on Oct 6 2020, 12:31 PM.

Details

Summary

Since eed3531328681397f07aa67715bbe59def7f4d98, the 'finally' clause silenced re-raised
exception because it contains a 'return' statement.

Diff Detail

Repository
rDCIDX Metadata indexer
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 D4151 (id=14640)

Rebasing onto 1eb521c98c...

First, rewinding head to replay your work on top of it...
Applying: Make BaseIndexer.catch_exception=False actually re-raise exceptions instead of silencing them.
Changes applied before test
commit 651ba6c1536af3418bcc0127388474830378e153
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Oct 6 12:31:10 2020 +0200

    Make BaseIndexer.catch_exception=False actually re-raise exceptions instead of silencing them.
    
    Since eed3531328681397f07aa67715bbe59def7f4d98, the 'finally' clause silenced re-raised
    exception because it contains a 'return' statement.

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

ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/indexer/tests/test_indexer.py
37

I don't even recall we had a self.catch_exceptions...

This revision is now accepted and ready to land.Oct 6 2020, 12:35 PM
swh/indexer/tests/test_indexer.py
37

So tests raises a nice error instead of silently passing and then crashing later when they check the content of the storage.. I just got bitten by this while refactoring the storage.

Build is green

Patch application report for D4151 (id=14641)

Rebasing onto 1eb521c98c...

Current branch diff-target is up to date.
Changes applied before test
commit 3ac0c155dad552fdd921561974d52164dcfc8820
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Oct 6 12:31:10 2020 +0200

    Make BaseIndexer.catch_exception=False actually re-raise exceptions instead of silencing them.
    
    Since eed3531328681397f07aa67715bbe59def7f4d98, the 'finally' clause silenced re-raised
    exception because it contains a 'return' statement.

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