]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
NVP plugin: Avoid timeouts if creating routers in parallel
authorSalvatore Orlando <salv.orlando@gmail.com>
Mon, 9 Dec 2013 15:53:24 +0000 (07:53 -0800)
committerSalvatore Orlando <salv.orlando@gmail.com>
Fri, 13 Dec 2013 11:26:01 +0000 (03:26 -0800)
commite3d03eae48695ce093361cc143161efa3daaaaa2
tree3968f2fbef5e2c5313a6b839811fb58f39b17bcc
parentc1d7d86fc477a27c452a3d5e624878fef0e264fa
NVP plugin: Avoid timeouts if creating routers in parallel

There is a well-known issue of eventlet causing deadlocks with
mysql transactions; such condition might occur when
creating NVP routers in parallel.

To avoid this, this patch moves the long-running method
_update_router_gw_info outside of the mysql transaction, adding
the appropriate failure management code, and adds a lock to the
method _nvp_create_ext_gw_port, to ensure serial access to it.

Unit tests for verifying correct behaviour in case of failures
are added as well.

Closes Bug: #1251847

Change-Id: I2864e2f5bfd3982875ef9df97186f64a9fcaa0e0
neutron/plugins/nicira/NeutronPlugin.py
neutron/tests/unit/nicira/test_nicira_plugin.py