Merge lp:~jk0/nova/lp754983 into lp:~hudson-openstack/nova/trunk

Proposed by Josh Kearney
Status: Merged
Approved by: Rick Harris
Approved revision: 986
Merged at revision: 987
Proposed branch: lp:~jk0/nova/lp754983
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 13 lines (+3/-0)
1 file modified
nova/virt/libvirt_conn.py (+3/-0)
To merge this branch: bzr merge lp:~jk0/nova/lp754983
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Vish Ishaya (community) Approve
Devin Carlen (community) Approve
Review via email: mp+57566@code.launchpad.net

Description of the change

Try to be nicer to the DB when destroying a libvirt instance.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

good find, lgtm

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm.

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

is this enough of a performance issue to get into the release?

Revision history for this message
Devin Carlen (devcamcar) wrote :

It does look potentially pretty evil. I'd like to see an FFE for this. Very self contained and low risk.

Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm. +1 on FFe, very little risk, and much safer.

Long-term:

I'd like to see timeout here so we don't get into a situation where we poll on this for hours, days? on end.

Perhaps we should be using LoopingCall here, in which case, I'd like to see a timeout facility added to it so that we can re-use that throughout the codebase.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/virt/libvirt_conn.py'
2--- nova/virt/libvirt_conn.py 2011-04-11 14:17:29 +0000
3+++ nova/virt/libvirt_conn.py 2011-04-13 19:12:33 +0000
4@@ -372,6 +372,9 @@
5 instance['id'], state)
6 if state == power_state.SHUTOFF:
7 break
8+
9+ # Let's not hammer on the DB
10+ time.sleep(1)
11 except Exception as ex:
12 msg = _("Error encountered when destroying instance '%(id)s': "
13 "%(ex)s") % {"id": instance["id"], "ex": ex}