]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Handle race condition on subnet-delete
authorEugene Nikanorov <enikanorov@mirantis.com>
Wed, 8 Apr 2015 22:16:18 +0000 (01:16 +0300)
committerEugene Nikanorov <enikanorov@mirantis.com>
Mon, 13 Apr 2015 07:13:00 +0000 (10:13 +0300)
commit1642bca4d9c4fee15129f74d93300c1eab1afd29
tree7a71600049ef1703380aec8026bbfbf7c7b51cc6
parent9c0f00a0a7b7b8b794b4858eb7f635fe2eba560c
Handle race condition on subnet-delete

This fix targets quite rare case of race condition between
port creation and subnet deletion. This usually happens
during API tests that do things quickly.
DHCP port is being created after delete_subnet checks for
DHCP ports, but before it checks for IPAllocations on subnet.
The solution is to apply retrying logic, which is really necessary
as we can't fetch new IPAllocations with the same query and within
the active transaction in mysql because of REPEATABLE READ
transaction isolation.

Change-Id: Ib9da018e654cdee3b64aa38de90f171c92ee28ee
Closes-Bug: 1357055
neutron/db/db_base_plugin_v2.py
neutron/plugins/ml2/plugin.py
neutron/tests/unit/plugins/ml2/test_plugin.py