Saggi Mizrahi has uploaded a new change for review.

Change subject: infra: Add logging in case PoolHandler crashes
......................................................................

infra: Add logging in case PoolHandler crashes

This helps for debugging cases where the helper crashes because of bugs
rather than an IO error

We only do it if the process closes in a timely fashion as it might be
in D state for a long time.

Change-Id: Ie488886a608a6855019d4c36eb2b31c9a941f8c8
Signed-off-by: Saggi Mizrahi <[email protected]>
---
M vdsm/storage/remoteFileHandler.py
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/26/14626/1

diff --git a/vdsm/storage/remoteFileHandler.py 
b/vdsm/storage/remoteFileHandler.py
index ad0f4a6..bd3f8b7 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -217,6 +217,8 @@
 
 
 class PoolHandler(object):
+    log = logging.getLogger("RepoFileHelper.PoolHandler")
+
     def __init__(self):
         myRead, hisWrite = os.pipe()
         hisRead, myWrite = os.pipe()
@@ -246,6 +248,15 @@
         except:
             pass
 
+        self.process.poll()
+        # Don't try to read if the process is in D state
+        if (self.process.returncode is not None and
+                self.process.returncode != 0):
+            err = self.process.stderr.read()
+            out = self.process.stdout.read()
+            self.log.debug("Pool handler existed, OUT: '%s' ERR: '%s'",
+                           out, err)
+
         try:
             zombieReaper.autoReapPID(self.process.pid)
         except AttributeError:


--
To view, visit http://gerrit.ovirt.org/14626
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie488886a608a6855019d4c36eb2b31c9a941f8c8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to