Add some extra logging around external event handling

While debugging a failed event delivery bug, I realized that our
logging of the event path leaves some ambiguity which makes it
difficult to follow. This adds the instance host to the existing
debug message on the API side, which helps to identify that events
are being sent to the right (or wrong) host. Further, which logs
a warning in the case where a compute host receives an instance
message when no thread was waiting for it.

Change-Id: I9a1461493a19750fe5dc11869cfa33d2e6fd3c6f
This commit is contained in:
Dan Smith 2016-10-04 07:29:50 -07:00
parent d98712d76a
commit 453e71d76e
2 changed files with 7 additions and 2 deletions

View File

@ -85,9 +85,10 @@ class ServerExternalEventsController(wsgi.Controller):
accepted_events.append(event)
accepted_instances.add(instance)
LOG.info(_LI('Creating event %(name)s:%(tag)s for '
'instance %(instance_uuid)s'),
'instance %(instance_uuid)s on %(host)s'),
{'name': event.name, 'tag': event.tag,
'instance_uuid': event.instance_uuid})
'instance_uuid': event.instance_uuid,
'host': instance.host})
# NOTE: as the event is processed asynchronously verify
# whether 202 is a more suitable response code than 200
_event['status'] = 'completed'

View File

@ -6635,6 +6635,10 @@ class ComputeManager(manager.Manager):
LOG.debug('Processing event %(event)s',
{'event': event.key}, instance=instance)
_event.send(event)
else:
LOG.warning(_LW('Received unexpected event %(event)s for '
'instance'),
{'event': event.key}, instance=instance)
def _process_instance_vif_deleted_event(self, context, instance,
deleted_vif_id):