neutron/doc/source
Ann Kamyshnikova 924f19e8f1 Make object creation methods in l3_hamode_db atomic
Methods _create_ha_network, add_ha_port don't have wrapping
transaction in them, so they are prone to race conditions.
This commit adds a transaction to them. To avoid problem with
rolling back outmost transaction during exception handling,
internal methods have been wrapped in nested transaction.

Nested transaction is required in places like this:

def create():
      create_something()
      try:
            _do_other_thing()
      except Exception:
             with excutils.save_and_reraise_exception():
                     delete_something()

def _do_other_thing():
     with context.session.begin(subtransactions=True):
         ....

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.

A new method safe_creation and has been added
that provides a common way of handling such situations.

Closes-bug: #1501686

Change-Id: I952f6f7f8684743aa7f829bd92b1dc41b2c6aecf
2016-01-18 13:36:39 +03:00
..
dashboards Fix URLs for pep8, and unit tests jobs 2016-01-13 12:14:11 -08:00
devref Make object creation methods in l3_hamode_db atomic 2016-01-18 13:36:39 +03:00
policies Merge "Add opnfv tag to the list of auto-complete tags" 2016-01-17 20:35:15 +00:00
stadium Merge "Updating devref for networking-onos project" 2015-12-16 07:24:56 +00:00
conf.py Fixing the deprecated library function. 2015-12-30 08:35:44 -08:00
index.rst Delete stale neutron-server manual 2015-12-04 18:43:28 -08:00