n-net: add more debug logging to release_fixed_ip

Despite commit 8c76902212 we're still
seeing this race in the gate so add more debug logging in the
release_fixed_ip method to get a better idea of what's going on.

Related-Bug: #1249065

Change-Id: I9eda6cadf8aa31576bedf10c71c41fe1a3d4d629
This commit is contained in:
Matt Riedemann 2015-07-01 06:56:32 -07:00
parent a4d4cdd50c
commit fd471b2fc1
1 changed files with 21 additions and 8 deletions

View File

@ -1127,15 +1127,28 @@ class NetworkManager(manager.Manager):
# should ignore the request so we don't disassociate the fixed IP
# from the wrong instance.
if mac:
LOG.debug('Checking to see if virtual interface with MAC '
'%(mac)s is still associated to instance.',
{'mac': mac}, instance_uuid=fixed_ip.instance_uuid)
vif = objects.VirtualInterface.get_by_address(context, mac)
if vif and vif.instance_uuid != fixed_ip.instance_uuid:
LOG.info(_LI("Ignoring request to release fixed IP "
"%(address)s with MAC %(mac)s since it is "
"now associated with a new instance that is "
"in the process of allocating it's network."),
{'address': address, 'mac': mac},
instance_uuid=fixed_ip.instance_uuid)
return
if vif:
LOG.debug('Found VIF: %s', vif,
instance_uuid=fixed_ip.instance_uuid)
if vif.instance_uuid != fixed_ip.instance_uuid:
LOG.info(_LI("Ignoring request to release fixed IP "
"%(address)s with MAC %(mac)s since it "
"is now associated with a new instance "
"that is in the process of allocating "
"it's network."),
{'address': address, 'mac': mac},
instance_uuid=fixed_ip.instance_uuid)
return
else:
LOG.debug('No VIF was found for MAC: %s', mac,
instance_uuid=fixed_ip.instance_uuid)
LOG.debug('Disassociating fixed IP %s from instance.', address,
instance_uuid=fixed_ip.instance_uuid)
fixed_ip.disassociate()
@staticmethod