Eventlet could cause an error replacing a resource during an update

Bug #1255506 reported by Zane Bitter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Zane Bitter

Bug Description

In resource.py we have the following code (which I wrote):

        except UpdateReplace:
            logger.debug(_("Resource %s update requires replacement") %
                         self.name)
            raise

This is dangerous, because eventlet can context-switch during the log call. If this happens then the exception that gets re-raised is not necessarily the UpdateReplace that we caught - it could be a random exception from another greenlet.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/58742
Committed: http://github.com/openstack/heat/commit/e53349ee7c6c06d8bb468ed2869429a144eaaf53
Submitter: Jenkins
Branch: master

commit e53349ee7c6c06d8bb468ed2869429a144eaaf53
Author: Zane Bitter <email address hidden>
Date: Wed Nov 27 12:55:45 2013 +0100

    Avoid eventlet-unsafe exception handling

    Eventlet can context-switch during a log call (at least in principle).
    Therefore it is unsafe to use "raise" after this call, because the exception
    raised may not be the same one caught by the "except" block, but rather
    could be any random exception from some other greenlet.

    This is a canonical example of why eventlet is pure evil.

    Fixes bug: #1255506

    Change-Id: Ieb0eb763c0fd696b82212653ac4909d2bddf6b88

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-1 → 2014.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.