[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Improve XendCheckpoint's forkHelper error handling.



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.