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

[Xen-API] [PATCH 3 of 3] CA-35893: add delay to the VM.hard_shutdown ret

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 3 of 3] CA-35893: add delay to the VM.hard_shutdown retry loop
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 17 Dec 2009 14:09:17 +0000
Delivery-date: Thu, 17 Dec 2009 06:09:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1261058954@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1261058926 0
# Node ID 5d6a3e43431f73d0af2bf28082960499819cd9b8
# Parent  cb2080bdb84a5aea257dbf71392453d9139afeb8
CA-35893: add delay to the VM.hard_shutdown retry loop.

When performing a VM.hard_shutdown we initially call Xc.domain_shutdown Halt 
and then later check the domain actually has shutdown. If the domain is running 
we assume that something like a reboot has happened in between and we retry.

It turns out that there's sometimes a delay between calling Xc.domain_shutdown 
and Xc.domain_getinfo reporting a shutdown domain: paper over this crack with 
the retry loop.

Ideally in future we'd look for domid changes => reboots but this requires a 
bit more refactoring to remember the old domid.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r cb2080bdb84a -r 5d6a3e43431f ocaml/xapi/xapi_vm.ml
--- a/ocaml/xapi/xapi_vm.ml     Thu Dec 17 14:08:46 2009 +0000
+++ b/ocaml/xapi/xapi_vm.ml     Thu Dec 17 14:08:46 2009 +0000
@@ -591,6 +591,7 @@
                  let aborting = n < 1 in
                  debug "Conflict when executing %s: %s" 
x.TwoPhase.api_call_name (if aborting then "aborting" else "retrying");
                  if aborting then raise e;
+                 Thread.delay 5.;
                  retry (n - 1) in
   retry 10
   
1 file changed, 1 insertion(+)
ocaml/xapi/xapi_vm.ml |    1 +


Attachment: xen-api.hg-3.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api