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] Improve XendCheckpoint's forkHelper error

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Improve XendCheckpoint's forkHelper error handling.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Dec 2006 09:14:08 -0800
Delivery-date: Sat, 16 Dec 2006 09:33:16 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 Brendan Cully <brendan@xxxxxxxxx>
# Date 1166060750 28800
# Node ID c38370be1e0e1197213a8f22a5ec8fbd9ba875b0
# Parent  63e72c3254da9023ad496276ff8547c2dd74db19
Improve XendCheckpoint's forkHelper error handling.

When inputHandler raises an exception, close stdin and stdout in the
child before attempting to close stderr, which is held open by a
separate thread. Without this patch, exceptions raised by device
migration caused xend to hang on child.childerr.close().

Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>
---
 tools/python/xen/xend/XendCheckpoint.py |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff -r 63e72c3254da -r c38370be1e0e tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Sat Dec 16 12:49:23 2006 +0000
+++ b/tools/python/xen/xend/XendCheckpoint.py   Wed Dec 13 17:45:50 2006 -0800
@@ -218,18 +218,17 @@ def forkHelper(cmd, fd, inputHandler, cl
                     log.debug('%s', line)
                     inputHandler(line, child.tochild)
 
-            thread.join()
-
         except IOError, exn:
             raise XendError('Error reading from child process for %s: %s' %
                             (cmd, exn))
     finally:
         child.fromchild.close()
-        child.childerr.close()
         if not closeToChild:
             child.tochild.close()
-
-    status = child.wait()
+        thread.join()
+        child.childerr.close()
+        status = child.wait()
+
     if status >> 8 == 127:
         raise XendError("%s failed: popen failed" % string.join(cmd))
     elif status != 0:

_______________________________________________
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] Improve XendCheckpoint's forkHelper error handling., Xen patchbot-unstable <=