From 5fb2c41f290c82936c7ef0d8dd3894891f25904b Mon Sep 17 00:00:00 2001 From: Joe Mills Date: Fri, 21 Nov 2014 10:55:10 +0900 Subject: [PATCH] Move network and port locks to separate locks * Because any plugin call can (in theory) be called from any other plugin call, each resource type needs its own lock to avoid deadlocks Change-Id: Ia910aa8420f110d56140078e2502d86fc9a9eb4c Signed-off-by: Joe Mills (cherry picked from commit 2798517eff847ad5d9decbb5727dddac5242fbd4) --- midonet/neutron/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/midonet/neutron/plugin.py b/midonet/neutron/plugin.py index dacbed8..c40eabd 100644 --- a/midonet/neutron/plugin.py +++ b/midonet/neutron/plugin.py @@ -198,7 +198,7 @@ def update_network(self, context, id, network): return net @util.handle_api_error - @utils.synchronized('midonet-critical-section', external=True) + @utils.synchronized('midonet-network-lock', external=True) def delete_network(self, context, id): """Delete a network and its corresponding MidoNet bridge.""" LOG.info(_("MidonetPluginV2.delete_network called: id=%r"), id) @@ -285,7 +285,7 @@ def _process_create_port(self, context, port): return new_port @util.handle_api_error - @utils.synchronized('midonet-critical-section', external=True) + @utils.synchronized('midonet-port-lock', external=True) def create_port(self, context, port): """Create a L2 port in Neutron/MidoNet.""" LOG.info(_("MidonetPluginV2.create_port called: port=%r"), port) @@ -305,7 +305,7 @@ def create_port(self, context, port): return new_port @util.handle_api_error - @utils.synchronized('midonet-critical-section', external=True) + @utils.synchronized('midonet-port-lock', external=True) def delete_port(self, context, id, l3_port_check=True): """Delete a neutron port and corresponding MidoNet bridge port.""" LOG.info(_("MidonetPluginV2.delete_port called: id=%(id)s "