]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Move plugin.delete_port call out of transaction
authorEugene Nikanorov <enikanorov@mirantis.com>
Sat, 19 Jul 2014 13:08:53 +0000 (17:08 +0400)
committerEugene Nikanorov <enikanorov@mirantis.com>
Sat, 19 Jul 2014 13:08:53 +0000 (17:08 +0400)
This might fix a few cases of lock wait timeouts.

Change-Id: Iaa656a8582b2ff3ec55709bbe47b1ac9f5fc2a99
Closes-Bug: #1342166

neutron/db/loadbalancer/loadbalancer_db.py

index e81e0bd74cc4a1f2a8e532c5ae3f6def5ad8532b..eb039d48f7fa22c0bc51749c1419449fbd99ca10 100644 (file)
@@ -460,8 +460,8 @@ class LoadBalancerPluginDb(loadbalancer.LoadBalancerPluginBase,
                 pool.update({"vip_id": None})
 
             context.session.delete(vip)
-            if vip.port:  # this is a Neutron port
-                self._core_plugin.delete_port(context, vip.port.id)
+        if vip.port:  # this is a Neutron port
+            self._core_plugin.delete_port(context, vip.port.id)
 
     def get_vip(self, context, id, fields=None):
         vip = self._get_resource(context, Vip, id)