diff options
author | melanie witt <melwittt@gmail.com> | 2022-05-03 01:48:36 +0000 |
---|---|---|
committer | melanie witt <melwittt@gmail.com> | 2022-05-03 02:03:26 +0000 |
commit | 1d4dbfd4680d32d0619e84dbe563deed892e0506 (patch) | |
tree | 7df666b69f4746bb4b3fceb11497fc20d89930c2 /nova/context.py | |
parent | b8cc5704558d3c08fda9db2f1bb7fecb2bcd985d (diff) | |
download | nova-1d4dbfd4680d32d0619e84dbe563deed892e0506.tar.gz |
Log the exception returned from a cell during API.get()
When getting an instance using the compute.API we call
scatter_gather_single_cell() to be able to capture details when we fail
to retrieve a result from a cell such as timeouts and exceptions.
Currently however, we aren't logging the content of an exception if
scatter_gather_single_cell() returns an exception as the result. The
scatter gather method itself logs exceptions that are not of type
NovaException as these represent definite unexpected errors such as
database errors but NovaException handling are left for the caller to
decide whether they want to log it or re-raise it and so on.
It can be difficult to debug a situation where a cell is returning a
NovaException result so this adds logging of the exception content in
the compute API when we encounter an unexpected NovaException.
The existing log message has been updated to more accurately reflect
what has happened (did not respond vs exception). The assignment of the
exception object in scatter gather has also been updated to not
unnecessarily construct a new exception object because it (a) wasn't
necessary and (b) made asserting the LOG.exception() call argument in
the unit test difficult.
Related-Bug: #1970087
Change-Id: Iae1c61c72be5b6017b934293e3dc079a24eeb0e7
Diffstat (limited to 'nova/context.py')
-rw-r--r-- | nova/context.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/context.py b/nova/context.py index 619c39e212..dc42b38b5b 100644 --- a/nova/context.py +++ b/nova/context.py @@ -424,7 +424,7 @@ def scatter_gather_cells(context, cell_mappings, timeout, fn, *args, **kwargs): # Only log the exception traceback for non-nova exceptions. if not isinstance(e, exception.NovaException): LOG.exception('Error gathering result from cell %s', cell_uuid) - result = e.__class__(e.args) + result = e # The queue is already synchronized. queue.put((cell_uuid, result)) |