xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Shriram Rajagopalan <rshriram@cs.ubc.ca>
To: xen-devel@lists.xensource.com
Subject: [PATCH] remus: proper cleanup on checkpoint failure
Date: Thu, 07 Apr 2011 13:05:22 -0700	[thread overview]
Message-ID: <a73514445065390ae70c.1302206722@athos.nss.cs.ubc.ca> (raw)

# HG changeset patch
# User Shriram Rajagopalan <rshriram@cs.ubc.ca>
# Date 1302204999 25200
# Node ID a73514445065390ae70c44e1708971dd6fa2a6f0
# Parent  97763efc41f9b664cf6f7db653c9c3f51e50b358
remus: proper cleanup on checkpoint failure.

While running remus, when an error occurs during checkpointing
(e.g., timeouts on primary, failing to checkpoint network buffer
or disk or even communication failure) the domU is sometimes
left in suspended state on primary. Instead of blindly closing
the checkpoint file handle, attempt to resume the domain before
the close.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>

diff -r 97763efc41f9 -r a73514445065 tools/python/xen/lowlevel/checkpoint/checkpoint.c
--- a/tools/python/xen/lowlevel/checkpoint/checkpoint.c	Tue Apr 05 18:23:54 2011 +0100
+++ b/tools/python/xen/lowlevel/checkpoint/checkpoint.c	Thu Apr 07 12:36:39 2011 -0700
@@ -80,6 +80,9 @@
 {
   CheckpointObject* self = (CheckpointObject*)obj;
 
+  if (checkpoint_resume(&self->cps) < 0)
+    fprintf(stderr, "%s\n", checkpoint_error(&self->cps));
+
   checkpoint_close(&self->cps);
 
   Py_XDECREF(self->suspend_cb);
diff -r 97763efc41f9 -r a73514445065 tools/python/xen/remus/save.py
--- a/tools/python/xen/remus/save.py	Tue Apr 05 18:23:54 2011 +0100
+++ b/tools/python/xen/remus/save.py	Thu Apr 07 12:36:39 2011 -0700
@@ -158,9 +158,13 @@
             self.checkpointer.open(self.vm.domid)
             self.checkpointer.start(self.fd, self.suspendcb, self.resumecb,
                                     self.checkpointcb, self.interval)
-            self.checkpointer.close()
         except xen.lowlevel.checkpoint.error, e:
             raise CheckpointError(e)
+        finally:
+            try: #errors in checkpoint close are not critical atm.
+                self.checkpointer.close()
+            except:
+                pass
 
     def _resume(self):
         """low-overhead version of XendDomainInfo.resumeDomain"""

         reply	other threads:[~2011-04-07 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 20:06 [SPAM] [PATCH] remus: blackhole replication target Shriram Rajagopalan
2011-04-07 20:05 ` Shriram Rajagopalan [this message]
2011-04-08 15:55   ` [PATCH] remus: proper cleanup on checkpoint failure [and 1 more messages] Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a73514445065390ae70c.1302206722@athos.nss.cs.ubc.ca \
    --to=rshriram@cs.ubc.ca \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).