From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH] Fix another race condition in xm destroy Date: Thu, 15 Sep 2005 23:42:34 -0500 Message-ID: <432A4D3A.6060300@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010404090102010902000207" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel , Christian Limpach List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010404090102010902000207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------010404090102010902000207 Content-Type: text/x-patch; name="6884-xm-destroy-race.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="6884-xm-destroy-race.diff" # HG changeset patch # User anthony@localhost.localdomain # 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 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): --------------010404090102010902000207 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010404090102010902000207--