]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix race condition in update_floatingip_statuses
authorAaron Rosen <aaronorosen@gmail.com>
Wed, 5 Mar 2014 03:19:40 +0000 (19:19 -0800)
committerThomas Goirand <thomas@goirand.fr>
Thu, 13 Mar 2014 07:20:44 +0000 (15:20 +0800)
If a floatingip is deleted before update_floatingip_statuses() is processed
FloatingIPNotFound is raised.

Change-Id: Idf03fda75ccd147673169c24e79921ca6d8fe754
Closes-bug: #1288036

neutron/db/l3_rpc_base.py

index 26b06ed23264e209aca97dd27177ec7cf5246184..d86d95698992717bf7461a1edfaaebf98f059114 100644 (file)
@@ -18,6 +18,7 @@ from oslo.config import cfg
 from neutron.common import constants
 from neutron.common import utils
 from neutron import context as neutron_context
+from neutron.extensions import l3
 from neutron.extensions import portbindings
 from neutron import manager
 from neutron.openstack.common import jsonutils
@@ -104,9 +105,13 @@ class L3RpcCallbackMixin(object):
                 LOG.debug(_("New status for floating IP %(floatingip_id)s: "
                             "%(status)s"), {'floatingip_id': floatingip_id,
                                             'status': status})
-                l3_plugin.update_floatingip_status(context,
-                                                   floatingip_id,
-                                                   status)
+                try:
+                    l3_plugin.update_floatingip_status(context,
+                                                       floatingip_id,
+                                                       status)
+                except l3.FloatingIPNotFound:
+                    LOG.debug(_("Floating IP: %s no longer present."),
+                              floatingip_id)
             # Find all floating IPs known to have been the given router
             # for which an update was not received. Set them DOWN mercilessly
             # This situation might occur for some asynchronous backends if