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
(cherry picked from commit d40322c7d4)
Conflicts:
neutron/agent/l3/dvr_fip_ns.py
neutron/tests/functional/agent/l3/test_dvr_router.py
Change-Id: Ia8c92cea2f8798582c39ad3450ab3b3c45a356f7