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: fix avoidance to restart domain on

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: fix avoidance to restart domain on crash
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Apr 2009 10:50:11 -0700
Delivery-date: Wed, 15 Apr 2009 10:50:35 -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 1239790982 -3600
# Node ID 9e29ba71e16994c578ad1ee43f3499bb9804bab1
# Parent  34dca01addc9917f0f4e4524856143ceb53b1a32
xend: fix avoidance to restart domain on crash

If a qemu-dm dies immediately (probably by wrong setting),
xend repeats to restart a domain so many times.=20
That causes system overload.

There is already a logic to avoid too early restarting, however,
it might not work. Since xenstore entry 'xend/previous_restart_time'
is volatile. XendDomainInfo.destroy() which removes the entry from
xenstore is called in some places.

Also, this patch prevents too early restarting even at the first
domain creation.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   22 +++++++---------------
 1 files changed, 7 insertions(+), 15 deletions(-)

diff -r 34dca01addc9 -r 9e29ba71e169 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Apr 15 08:40:12 2009 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Apr 15 11:23:02 2009 +0100
@@ -514,7 +514,6 @@ class XendDomainInfo:
         
         if reason not in DOMAIN_SHUTDOWN_REASONS.values():
             raise XendError('Invalid reason: %s' % reason)
-        self._removeVm('xend/previous_restart_time')
         self.storeDom("control/shutdown", reason)
 
         # HVM domain shuts itself down only if it has PV drivers
@@ -2001,20 +2000,13 @@ class XendDomainInfo:
         old_domid = self.domid
         self._writeVm(RESTART_IN_PROGRESS, 'True')
 
-        now = time.time()
-        rst = self._readVm('xend/previous_restart_time')
-        if rst:
-            rst = float(rst)
-            timeout = now - rst
-            if timeout < MINIMUM_RESTART_TIME:
-                log.error(
-                    'VM %s restarting too fast (%f seconds since the last '
-                    'restart).  Refusing to restart to avoid loops.',
-                    self.info['name_label'], timeout)
-                self.destroy()
-                return
-
-        self._writeVm('xend/previous_restart_time', str(now))
+        elapse = time.time() - self.info['start_time']
+        if elapse < MINIMUM_RESTART_TIME:
+            log.error('VM %s restarting too fast (Elapsed time: %f seconds). '
+                      'Refusing to restart to avoid loops.',
+                      self.info['name_label'], elapse)
+            self.destroy()
+            return
 
         prev_vm_xend = self._listRecursiveVm('xend')
         new_dom_info = self.info

_______________________________________________
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: fix avoidance to restart domain on crash, Xen patchbot-unstable <=