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] Do not destroy domains that timeout when shutting do

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Do not destroy domains that timeout when shutting down
From: john.levon@xxxxxxx
Date: Thu, 24 May 2007 20:42:06 -0700
Delivery-date: Thu, 24 May 2007 20:40:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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
# HG changeset patch
# User john.levon@xxxxxxx
# Date 1180046767 25200
# Node ID bfd2245773b4772671a5aa7772ff88554292de34
# Parent  c7dee061ade1ac0c4ef417ecadd98f048ddece96
Do not destroy domains that timeout when shutting down

Instead of violently destroying a domain that is not responding to a shutdown
request, rename the domain to indicate the problem and leave it alone; this
allows the admin to make corrective actions (which may or may not include
destroying the domain).

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/tools/python/xen/xend/XendDomainInfo.py 
b/tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -351,6 +351,7 @@ class XendDomainInfo:
         self.vmWatch = None
         self.shutdownWatch = None
         self.shutdownStartTime = None
+        self.unresponsive = False
         self._resume = resume
 
         self.state = DOM_STATE_HALTED
@@ -998,21 +999,25 @@ class XendDomainInfo:
                 # failed.  Ignore this domain.
                 pass
             else:
-                # Domain is alive.  If we are shutting it down, then check
-                # the timeout on that, and destroy it if necessary.
+                # Domain is alive.
                 if xeninfo['paused']:
                     self._stateSet(DOM_STATE_PAUSED)
                 else:
                     self._stateSet(DOM_STATE_RUNNING)
                     
-                if self.shutdownStartTime:
+                if self.shutdownStartTime and not self.unresponsive:
                     timeout = (SHUTDOWN_TIMEOUT - time.time() +
                                self.shutdownStartTime)
                     if timeout < 0:
+                        # The domain is not responding to shutdown requests.
+                        # Log a message, and rename the domain to indicate the
+                        # state; we keep the domain running, however, to
+                        # allow corrective action.
                         log.info(
                             "Domain shutdown timeout expired: name=%s id=%s",
                             self.info['name_label'], self.domid)
-                        self.destroy()
+                        self.setName('unresponsive-' + self.getName())
+                        self.unresponsive = True
         finally:
             self.refresh_shutdown_lock.release()
 
@@ -1299,6 +1304,7 @@ class XendDomainInfo:
         log.debug('XendDomainInfo.constructDomain')
 
         self.shutdownStartTime = None
+        self.unresponsive = False
 
         image_cfg = self.info.get('image', {})
         hvm = image_cfg.has_key('hvm')

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