]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
BigSwitch: Semaphore on port status update
authorKevin Benton <blak111@gmail.com>
Tue, 1 Apr 2014 06:32:41 +0000 (23:32 -0700)
committerKevin Benton <blak111@gmail.com>
Tue, 1 Apr 2014 06:35:17 +0000 (23:35 -0700)
Adds a semaphore to the _set_port_status
function used by the Big Switch ML2 driver and
plugin. Without it, the async threads are
susceptible to deadlocking and causing the
known eventlet/mysql timeout exception.

Closes-Bug: #1300607
Change-Id: Ie89213a0bef37f9e7a30945df39c0f1b87a33b82

neutron/plugins/bigswitch/plugin.py

index a5ba320813118a397e192a8977dc749dd7c540cb..161b71f8d1c6bb906235e457c69b61776e9c9faa 100644 (file)
@@ -436,6 +436,8 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
             # would have deleted an non-existent port.
             self.servers.rest_delete_port(tenant_id, net_id, port['id'])
 
+    # NOTE(kevinbenton): workaround for eventlet/mysql deadlock
+    @utils.synchronized('bsn-port-barrier')
     def _set_port_status(self, port_id, status):
         session = db.get_session()
         try: