WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fix another race condition in xm destroy
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Thu, 15 Sep 2005 23:42:34 -0500
Delivery-date: Fri, 16 Sep 2005 04:40:28 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050912)
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
<Prev in Thread] Current Thread [Next in Thread>