exception tracebacks are lost when using raise

Bug #845866 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Russell Bryant
oslo-incubator
Fix Released
Low
Russell Bryant
Grizzly
Fix Released
Low
Russell Bryant

Bug Description

Since switching the db code to use an eventlet library, we can no longer re-raise exceptions if there is any db access in the exception handler. There are a number of places in the code where this is done.

we need to change instances of

except <SomeException>:
  # code that uses db or rpc
  raise

to:

except <SomeException>:
  with excutils.save_and_reraise_exception():
    # code that uses db or rpc

Also adding a logging.exception('useful message') is probably a good idea in most cases if the original traceback is important.

Changed in nova:
importance: Undecided → Low
milestone: none → 2011.3
status: New → Triaged
Revision history for this message
Brian Lamar (blamar) wrote :

Arg, this is unfortunate. This whole eventlet + SQLAlchemy thing has been a pain...but I'm not sure how the rest of the world deals with it. Maybe I'll make a summit brainstorming session over this because it's been the source of a number of bugs.

Changed in nova:
milestone: 2011.3 → none
Changed in nova:
milestone: none → grizzly-rc1
tags: added: low-hanging-fruit
description: updated
Revision history for this message
Russell Bryant (russellb) wrote :

Added oslo as this affects impl_zmq

Changed in nova:
assignee: nobody → Russell Bryant (russellb)
Changed in oslo:
assignee: nobody → Russell Bryant (russellb)
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23565

Changed in oslo:
status: Confirmed → In Progress
Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/23566

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

This is actually a bug in eventlet. Here's the issue (and bug fix) for it:

https://bitbucket.org/eventlet/eventlet/issue/129/exception-info-clearing-is-problematic-and

Unfortunately, it hasn't been touched in months :(

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/23565
Committed: http://github.com/openstack/oslo-incubator/commit/f32af7b42e7801338583f67e794792f22df70a5d
Submitter: Jenkins
Branch: master

commit f32af7b42e7801338583f67e794792f22df70a5d
Author: Russell Bryant <email address hidden>
Date: Tue Mar 5 10:50:15 2013 -0500

    Preserve exceptions in impl_zmq.

    There is complication with re-raising exceptions and our usage of
    eventlet. If the code in the exception handler accesses the db or rpc
    in the exception handler, it will no longer be able to re-raise the
    exception. Using excutils.save_and_reraise_exception() works aorund
    this issue.

    The most common error is calling LOG.error() or LOG.exception(), as it
    is possible for these to go access rpc. There is an option to turn on
    notifications for these errors.

    Fix bug 845866.

    Change-Id: Ic914bba4703200ed114a42e3a55402883b430407

Changed in oslo:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/23566
Committed: http://github.com/openstack/nova/commit/2f983793574de07269c4a79852d75a9059465ee0
Submitter: Jenkins
Branch: master

commit 2f983793574de07269c4a79852d75a9059465ee0
Author: Russell Bryant <email address hidden>
Date: Tue Mar 5 10:55:18 2013 -0500

    Fix issues with re-raising exceptions.

    There is complication with re-raising exceptions and our usage of
    eventlet. If the code in the exception handler accesses the db or rpc
    in the exception handler, it will no longer be able to re-raise the
    exception. Using excutils.save_and_reraise_exception() works aorund
    this issue.

    The most common error is calling LOG.error() or LOG.exception(), as it
    is possible for these to go access rpc. There is an option to turn on
    notifications for these errors.

    Fix bug 845866.

    Change-Id: Icfca2af63805711229249aa7abe60a938edd1b35

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → grizzly-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.