Page MenuHomeSoftware Heritage

Use the db_transaction decorator on all _add() methods.
ClosedPublic

Authored by vlorentz on Apr 9 2019, 4:41 PM.

Details

Summary

So they gracefully release the connection on error instead
of relying on reference-counting to call the Db's __del__
(which does not happen in Hypothesis tests) because a ref
to it is kept via the traceback object.

Depends on D1380.

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont added a subscriber: ardumont.

Consistency love!

This revision is now accepted and ready to land.Apr 9 2019, 5:43 PM
olasd added a subscriber: olasd.

LGTM, thanks!

swh/storage/storage.py
839–842

Unnecessary listification here

845–846

Bad @vlorentz trying to introduce a DoS in prod.

This revision was automatically updated to reflect the committed changes.