Incorrect exception handling in DB code involving rollbacked transactions.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Ann Taraday | ||
Kilo |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I found out that some methods like add_ha_port https:/
def create():
create_
try:
except Exception:
with excutils.
def _do_other_thing():
with context.
....
The problem is that when exception is raised in _do_other_thing it is caught in except block, but the object cannot be deleted in except section because internal transaction has been rolled back. We have tests on these methods, but they also are not correct (for example https:/
The possible solution is to use nested transaction in such places like this:
def create()
with context.
try:
def _do_other_thing():
with context.
....
description: | updated |
Changed in neutron: | |
importance: | Undecided → Medium |
Changed in neutron: | |
status: | New → Confirmed |
tags: | added: l3-ha |
Changed in neutron: | |
assignee: | Ann Kamyshnikova (akamyshnikova) → Cedric Brandily (cbrandily) |
Changed in neutron: | |
assignee: | Cedric Brandily (cbrandily) → Ann Kamyshnikova (akamyshnikova) |
Fix proposed to branch: master /review. openstack. org/230481
Review: https:/