From 453e71d76e28c905d852d974bc2f728851b17e67 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Tue, 4 Oct 2016 07:29:50 -0700 Subject: [PATCH] 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 --- nova/api/openstack/compute/server_external_events.py | 5 +++-- nova/compute/manager.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/nova/api/openstack/compute/server_external_events.py b/nova/api/openstack/compute/server_external_events.py index ae1294df2f10..2fbeea4eaf25 100644 --- a/nova/api/openstack/compute/server_external_events.py +++ b/nova/api/openstack/compute/server_external_events.py @@ -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' diff --git a/nova/compute/manager.py b/nova/compute/manager.py index d9bd3ff42393..95eeef73a6a9 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -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):