DVR: Fix race condition in creation of fip gateway
In large-scale environments, we have seen a router update
arrive for one tenant while we are still creating the
router for a different tenant and initializing the shared
floating IP gateway port. Sometimes these updates can
get scheduled simultaneously, with the second running
before we are done creating all the resources in the
first, causing an exception when trying to set the
default route since either the interface or IP address
does not exist yet.
Add a lock to better synchronize these functions so
a create can finish before an update can be done.
If it still fails, we will throw an exception so that
the namespace will be cleaned-up and the update can be
re-scheduled for the next iteration.
Reviewed: https:/ /review. openstack. org/385617 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=d40322c7d4a a1dd6d595dfe415 278c9f252f4da2
Committed: https:/
Submitter: Jenkins
Branch: master
commit d40322c7d4aa1dd 6d595dfe415278c 9f252f4da2
Author: Swaminathan Vasudevan <email address hidden>
Date: Fri Oct 7 10:30:40 2016 -0700
DVR: Fix race condition in creation of fip gateway
In large-scale environments, we have seen a router update
arrive for one tenant while we are still creating the
router for a different tenant and initializing the shared
floating IP gateway port. Sometimes these updates can
get scheduled simultaneously, with the second running
before we are done creating all the resources in the
first, causing an exception when trying to set the
default route since either the interface or IP address
does not exist yet.
Add a lock to better synchronize these functions so
a create can finish before an update can be done.
If it still fails, we will throw an exception so that
the namespace will be cleaned-up and the update can be
re-scheduled for the next iteration.
Closes-Bug: #1631513 582c39ad3450ab3 b3c45a356f7
Change-Id: Ia8c92cea2f8798