Producing useless traceback info
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Medium
|
Rick Harris |
Bug Description
In some cases, the exceptions Glance is raising are next to useless because the traceback information was lost. The reason this is happening is that we're doing:
except Exception, e:
# do something that invokes eventlet
raise e
The `raise e` syntax doesn't re-raise in the same context as the original exception. To work around this we can do something like:
except Exception, e:
# NOTE(sirp): _safe_kill uses httplib which, in turn, uses
# Eventlet's GreenSocket. Eventlet subsequently clears exceptions
# by calling `sys.exc_clear()`.
# To work around this, we memorize the exception context, and then re-raise in 3-arg form after running the eventlet related code
raise exc_type, exc_value, exc_traceback
Related branches
- Jay Pipes (community): Approve
- Devin Carlen (community): Approve
- Soren Hansen (community): Approve
-
Diff: 35 lines (+11/-5)1 file modifiedglance/server.py (+11/-5)
Changed in glance: | |
assignee: | nobody → Rick Harris (rconradharris) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in glance: | |
status: | In Progress → Fix Committed |
Changed in glance: | |
milestone: | none → 2011.2 |
status: | Fix Committed → Fix Released |
Hey Rick, would a blank raise do the same thing for you?
except Exception: _safe_kill( req, image_meta)
self.
raise
should raise the original exception in the original context.