From dd9d8db3ddf40add17adc0178c5d3c19f1e3ebb6 Mon Sep 17 00:00:00 2001 From: Gary Kotton Date: Thu, 30 Jun 2016 06:59:37 -0700 Subject: [PATCH] NSX|V: ensure route update is aromic for shared routers Ensure that the route update is atomic. Change-Id: Ie3c9d3fdb2505b53839faeacdc1ed1c7e2ad6e2f --- .../plugins/nsx_v/drivers/shared_router_driver.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py index 7be0865268..192977bfab 100644 --- a/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/shared_router_driver.py @@ -331,11 +331,12 @@ class RouterSharedDriver(router_driver.RouterBaseDriver): self._add_router_services_on_available_edge(context, router_id) else: - router_ids = self.edge_manager.get_routers_on_same_edge( - context, router_id) - if router_ids: - self._update_routes_on_routers( - context, router_id, router_ids) + with locking.LockManager.get_lock(str(edge_id)): + router_ids = self.edge_manager.get_routers_on_same_edge( + context, router_id) + if router_ids: + self._update_routes_on_routers( + context, router_id, router_ids) def _get_ext_net_ids(self, context, router_ids): ext_net_ids = []