oslo.db now wraps all DB exceptions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Eugeniya Kudryashova |
Bug Description
tl;dr
In a few versions of oslo.db (maybe when we release 1.0.0?), every project using oslo.db should inspect their code and remove usages of 'raw' DB exceptions like IntegrityError/
Full version
A recent commit to oslo.db changed the way the 'raw' DB exceptions are wrapped (e.g. IntegrityError, OperationalError, etc). Previously, we used decorators on Session methods and wrapped those exceptions with oslo.db custom ones. This is mostly useful for handling them later (e.g. to retry DB API methods on deadlocks).
The problem with Session decorators was that it wasn't possible to catch and wrap all possible exceptions. E.g. SA Core exceptions and exceptions raised in Query.all() calls were ignored. Now we are using a low level SQLAlchemy event to catch all possible DB exceptions. This means that if consuming projects had workarounds for those cases and expected 'raw' exceptions instead of oslo.db ones, they would be broken. That's why we *temporarily* added both 'raw' exceptions and new ones to expect clauses in consuming projects code when they were ported to using of oslo.db to make the transition smooth and allow them to work with different oslo.db versions.
On the positive side, we now have a solution for problems like https:/
In a few releases of oslo.db we can safely remove 'raw' DB exceptions like IntegrityError/
oslo.db exceptions and their description: https:/
description: | updated |
tags: | added: db |
description: | updated |
Changed in nova: | |
assignee: | nobody → Eugeniya Kudryashova (ekudryashova) |
status: | New → In Progress |
Changed in nova: | |
milestone: | none → juno-rc1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | juno-rc1 → 2014.2 |
Reviewed: https:/ /review. openstack. org/101901 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=1b83b2f1105 4ddd3f72fe75c5c ef496060afcb3a
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1b83b2f11054ddd 3f72fe75c5cef49 6060afcb3a
Author: Andrey Kurilin <email address hidden>
Date: Sat Jun 21 13:56:42 2014 +0300
Move to oslo.db
Replace common oslo code nova.openstack. common. db by usage
of oslo.db library and remove common code.
Replaced catching of raw sqlalchemy exceptions by catches
of oslo.db exceptions(such as DBError, DBDuplicateEntry, etc).
Co-Authored-By: Eugeniya Kudryashova <email address hidden>
Closes-Bug: #1364986 18ec85ed5d70259 c949408e64b
Closes-Bug: #1353131
Closes-Bug: #1283987
Closes-Bug: #1274523
Change-Id: I0649539e071b23