yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #21189
[Bug 1088823] Re: context cannot be gotten from args of run_instance() If _spawn() raises ProcessExecutionError
** Changed in: nova
Status: Incomplete => Invalid
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1088823
Title:
context cannot be gotten from args of run_instance() If _spawn()
raises ProcessExecutionError
Status in OpenStack Compute (Nova):
Invalid
Bug description:
Outline:
If nova.compute.manager.ComputeManager._spawn() raises Exception (e.g. ProcessExecutionError) in os-volumes_boot,
context cannot be gotten from args of run_instance() via nova.exception.get_context_from_function_and_args().
Because context(2nd arg) of run_instance() is not
nova.context.RequestContext but
nova.openstack.common.rpc.amqp.RpcConext class.
Notice:
I set following FLAGS.flags (for no re-scheduling).
<pre>
scheduler_max_attempts=1
</pre>
Detail:
When Exception (e.g. ProcessExecutionError) is raised in run_instance(), the exception is handled by nova.exception.wrap_exception().
See nova.exception.get_context_from_function_and_args().
Context is intended to be gotten as nova.context.RequestContext class, so in my case nova.openstack.common.rpc.amqp.RpcConext object is returned as None.
<pre><code class="python">
def get_context_from_function_and_args(function, args, kwargs):
"""Find an arg of type RequestContext and return it.
This is useful in a couple of decorators where we don't
know much about the function we're wrapping.
"""
# import here to avoid circularity:
from nova import context
for arg in itertools.chain(kwargs.values(), args):
if isinstance(arg, context.RequestContext):
return arg
return None
</code></pre>
I'd like to use request_id of context via notifier.notify() in the error case.
Please fix this bug, or let me know how to realize it.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1088823/+subscriptions