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
Change-Id: Ia8c92cea2f8798582c39ad3450ab3b3c45a356f7
(cherry picked from commit d40322c7d4aa1dd6d595dfe415278c9f252f4da2)
Reviewed: https:/ /review. openstack. org/413240 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=95d93495d74 3115808b5117408 99d649cab6b5ae
Committed: https:/
Submitter: Jenkins
Branch: stable/newton
commit 95d93495d743115 808b511740899d6 49cab6b5ae
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 6d595dfe415278c 9f252f4da2)
Change-Id: Ia8c92cea2f8798
(cherry picked from commit d40322c7d4aa1dd