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-changelog

[Xen-changelog] [xen-unstable] xend: Ignore errors from dying domains in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Ignore errors from dying domains in RPC server
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jul 2008 07:50:14 -0700
Delivery-date: Fri, 11 Jul 2008 07:50:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1215776870 -3600
# Node ID a762b4aed1a8f0339e2822da728b9d4a71f32033
# Parent  e10b682f148d9db312a68f82221e41b1d5e711a8
xend: Ignore errors from dying domains in RPC server

When a domain is in the process of shutting down there is a small
window when the domain is known to XenD, but it will be unable to form
an SXPR for it due it being in the middle of device hot-unplug. This
causes the 'xm list' command to totally fail with an error like

# xm list
Error: Device 0 not connected
Usage: xm list [options] [Domain, ...]

The 'xm list' command calls into the 'domains' method of
XMLRPCServer.py in XenD. This method just iterates over the list of
domains, fetching the sxpr for each in turn, but with no exception
handling. So if a single domain fails to generate an sxpr, no data is
returned even for other domains which are still functional.  This
patch simply makes XenD ignore and skip over domains which throw an
exception, logging the problematic domain.

NB, this problem only hits 'xm list' if it is configured to use the
legay XMLRPC server instead of XenAPI.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 tools/python/xen/xend/server/XMLRPCServer.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -r e10b682f148d -r a762b4aed1a8 
tools/python/xen/xend/server/XMLRPCServer.py
--- a/tools/python/xen/xend/server/XMLRPCServer.py      Fri Jul 11 12:46:33 
2008 +0100
+++ b/tools/python/xen/xend/server/XMLRPCServer.py      Fri Jul 11 12:47:50 
2008 +0100
@@ -64,7 +64,14 @@ def domains_with_state(detail, state, fu
 def domains_with_state(detail, state, full):
     if detail:
         domains = XendDomain.instance().list_sorted(state)
-        return map(lambda dom: fixup_sxpr(dom.sxpr(not full)), domains)
+        ret = []
+        for dom in domains:
+            try:
+                ret.append(fixup_sxpr(dom.sxpr(not full)))
+            except:
+                log.warn("Failed to query SXPR for domain %s" % str(dom))
+                pass
+        return ret
     else:
         return XendDomain.instance().list_names(state)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: Ignore errors from dying domains in RPC server, Xen patchbot-unstable <=