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

vlorentz created this revision.Apr 9 2019, 4:41 PM
ardumont accepted this revision.Apr 9 2019, 5:43 PM
ardumont added a subscriber: ardumont.

Consistency love!

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

LGTM, thanks!

swh/storage/storage.py
840–843

Unnecessary listification here

845–846

Bad @vlorentz trying to introduce a DoS in prod.

vlorentz updated this revision to Diff 4464.Apr 9 2019, 5:46 PM
  • Remove debugging stuff
This revision was automatically updated to reflect the committed changes.