use of threading in libvirt driver causes deadlock when connecting to libvirtd

Bug #1252409 reported by Michael Kerrin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Michael Kerrin
Havana
Fix Released
Undecided
Unassigned

Bug Description

the libvirt driver was running into this issue https://bitbucket.org/eventlet/eventlet/issue/137/use-of-threading-locks-causes-deadlock when trying to connect to the libvirtd daemon.

the driver has logging messages during the _connect method which was called within a native thread. The logging code takes out a eventlet lock and mixing OS native threads and eventlet locks causes deadlocks due to the above eventlet bug. The resulting deadlock was enough to hang the nova-compute process.

description: updated
Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
status: New → In Progress
assignee: nobody → Michael Kerrin (michael-kerrin-w)
Changed in nova:
importance: Undecided → High
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/57000
Committed: http://github.com/openstack/nova/commit/e4b0d8e9446ad3ad3a514b9cf65722f6ed95888d
Submitter: Jenkins
Branch: master

commit e4b0d8e9446ad3ad3a514b9cf65722f6ed95888d
Author: Michael Kerrin <email address hidden>
Date: Mon Nov 18 17:25:50 2013 +0000

    Use of logging in native thread causes deadlock connecting to libvirtd

    When connecting to libvirtd daemon we were calling the _connect
    method in a native thread. The use of logging in this method hit this
    bug in eventlet https://bitbucket.org/eventlet/eventlet/issue/137/
    causing nova-compute to hang.

    Closes-Bug: #1252409

    Change-Id: I0d22c3ed1b3288aeb1afae130f11a4f38dc6440a

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
Revision history for this message
Matt Riedemann (mriedem) wrote :

I'm looking to backport this to stable/havana but it requires (in order):

https://review.openstack.org/#/c/55866/
https://review.openstack.org/#/c/54595/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/112421

Matt Riedemann (mriedem)
tags: removed: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/havana)

Reviewed: https://review.openstack.org/112421
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=48d19691e21ddf7f52d8f80c67353e6a3e54552e
Submitter: Jenkins
Branch: stable/havana

commit 48d19691e21ddf7f52d8f80c67353e6a3e54552e
Author: Michael Kerrin <email address hidden>
Date: Mon Nov 18 17:25:50 2013 +0000

    Use of logging in native thread causes deadlock connecting to libvirtd

    When connecting to libvirtd daemon we were calling the _connect
    method in a native thread. The use of logging in this method hit this
    bug in eventlet https://bitbucket.org/eventlet/eventlet/issue/137/
    causing nova-compute to hang.

    Closes-Bug: #1252409

    Conflicts:
            nova/virt/libvirt/driver.py

    NOTE(mriedem): The conflict is due to set_host_enabled
    being used in the original change in Icehouse and the
    option rename for libvirt_nonblocking.

    Change-Id: I0d22c3ed1b3288aeb1afae130f11a4f38dc6440a
    (cherry picked from commit e4b0d8e9446ad3ad3a514b9cf65722f6ed95888d)

tags: added: in-stable-havana
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.