libvirt wait_for_block_job_info can infinitely loop

Bug #1260123 reported by Eric Harney
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Eric Harney
Havana
Fix Released
Medium
Eric Harney

Bug Description

Callers of wait_for_block_job_info may loop infinitely if the job doesn't exist, since libvirt returns an empty dict which this function interprets as cur=0 and end=0 => return True.

I think it should do:

if not any(status):
    return False

Affects online deletion of Cinder GlusterFS snapshots, and possibly other callers of this (live_snapshot).

See http://libvirt.org/git/?p=libvirt-python.git;a=commit;h=f8bc3a9ccc

(Encountered issue on Fedora 19 w/ virt-preview repo, libvirt 1.1.3.)

Tags: libvirt
Eric Harney (eharney)
Changed in nova:
assignee: nobody → Eric Harney (eharney)
Gary Kotton (garyk)
tags: added: libvirt
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/63221

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

Reviewed: https://review.openstack.org/63221
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e3ac20fca7494122a4c0ed2edc00377aa92cb49d
Submitter: Jenkins
Branch: master

commit e3ac20fca7494122a4c0ed2edc00377aa92cb49d
Author: Eric Harney <email address hidden>
Date: Thu Dec 19 16:21:25 2013 -0500

    libvirt: Fix infinite loop waiting for block job

    Libvirt may return an empty dict when a block job has completed.
    In this case, _wait_for_block_job will return True, causing
    its callers to loop.

    Affects volume_snapshot_delete, swap_volume, and live_snapshot.

    (See http://libvirt.org/git/?p=libvirt.git;a=commit;h=0f9e67bf )

    Closes-Bug: #1260123
    Change-Id: Iab81299f0ce32a14e46aee0fd389ed29f7e503b8

Changed in nova:
status: In Progress → Fix Committed
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/66403

Changed in nova:
milestone: none → icehouse-2
Changed in nova:
importance: Undecided → Medium
tags: added: havana-backport-potential
tags: removed: havana-backport-potential
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/havana)

Reviewed: https://review.openstack.org/66403
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=17f27bf1843b0efa89a6b3f507fa47f815fbe3fc
Submitter: Jenkins
Branch: stable/havana

commit 17f27bf1843b0efa89a6b3f507fa47f815fbe3fc
Author: Eric Harney <email address hidden>
Date: Thu Dec 19 16:21:25 2013 -0500

    libvirt: Fix infinite loop waiting for block job

    Libvirt may return an empty dict when a block job has completed.
    In this case, _wait_for_block_job will return True, causing
    its callers to loop.

    Affects volume_snapshot_delete, swap_volume, and live_snapshot.

    (See http://libvirt.org/git/?p=libvirt.git;a=commit;h=0f9e67bf )

    Closes-Bug: #1260123
    Change-Id: Iab81299f0ce32a14e46aee0fd389ed29f7e503b8
    (cherry picked from commit e3ac20fca7494122a4c0ed2edc00377aa92cb49d)

Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 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.