diff options
| author | Brian Elliott <brian.elliott@rackspace.com> | 2012-12-19 22:57:26 +0000 |
|---|---|---|
| committer | Brian Elliott <brian.elliott@rackspace.com> | 2012-12-21 17:00:08 +0000 |
| commit | 9f01b105fa3f240d9cae88a5b305b4cc312e95f4 (patch) | |
| tree | f4268988e7cbe74e0d5250a0a1ed6dfcf89ca843 /nova/compute | |
| parent | 51e34aa44d4c67eb326c0ec57f1cd4d32e46438a (diff) | |
Log last compute error when rescheduling.
When a scheduling attempt is re-tried, log the last exception from
the compute side. The goal is to provide simpler access to debugging
information about why a build/resize is having issues.
Change-Id: Ic31852dcbbf1cea9034a4b8eb1c7d20178c3229d
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/manager.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 6efc83fb9..3f609c027 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -675,7 +675,7 @@ class ComputeManager(manager.SchedulerDependentManager): rescheduled = self._reschedule(context, request_spec, filter_properties, instance['uuid'], self.scheduler_rpcapi.run_instance, method_args, - task_state) + task_state, exc_info) except Exception: rescheduled = False @@ -690,7 +690,8 @@ class ComputeManager(manager.SchedulerDependentManager): raise exc_info[0], exc_info[1], exc_info[2] def _reschedule(self, context, request_spec, filter_properties, - instance_uuid, scheduler_method, method_args, task_state): + instance_uuid, scheduler_method, method_args, task_state, + exc_info=None): """Attempt to re-schedule a compute operation.""" retry = filter_properties.get('retry', None) @@ -714,6 +715,10 @@ class ComputeManager(manager.SchedulerDependentManager): # reset the task state: self._instance_update(context, instance_uuid, task_state=task_state) + if exc_info: + # stringify to avoid circular ref problem in json serialization: + retry['exc'] = traceback.format_exception(*exc_info) + scheduler_method(context, *method_args) return True @@ -1871,7 +1876,7 @@ class ComputeManager(manager.SchedulerDependentManager): rescheduled = self._reschedule(context, request_spec, filter_properties, instance_uuid, scheduler_method, - method_args, task_state) + method_args, task_state, exc_info) except Exception: rescheduled = False LOG.exception(_("Error trying to reschedule"), |
