[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Fix another race condition in xm destroy



There's a race condition in xm destroy that gets triggered when xc_domain_destroy results in a domain disappearing before we invoke the cleanup routines. Specifically, the saveToDB routines will through a No such process error.

Christian, I'd appreciate if you could sanity check this before committing. I think it's okay because starting the cleanup shouldn't have any adverse effects. Having another pair of eyes confirm it would make me feel better though :-)

BTW, this is not the fix for the xm destroy && xm create race condition. Just another one I found in the process.

Regards,

Anthony Liguori
# HG changeset patch
# User anthony@xxxxxxxxxxxxxxxxxxxxx
# Node ID 2790025adf8eae599d026c9ad6f0b3deacda9b9f
# Parent  fd19e760932d095b23d38e67eaec24dd02ba3aba
Fix a race in xm destroy.  Once we call xc_domain_destroy, there's no guarentee
that the domain will exist (even immediately after the call).

Starting the cleanup before we call destroy will keep us from getting hosed.

Signed-off-by: Anthony Liguori <aliguori@xxxxxxxxxx>

diff -r fd19e760932d -r 2790025adf8e tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Sep 15 19:46:14 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Sep 16 04:35:26 2005
@@ -771,9 +771,9 @@
     def destroy(self):
         """Clenup vm and destroy domain.
         """
-        self.destroy_domain()
         self.cleanup()
         self.saveToDB()
+        self.destroy_domain()
         return 0
 
     def is_terminated(self):
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.