[NEW PATCH] Related to BZ#723579 - OOP Handlers shouldn't print to stdout on failure (via gerrit-bot)

Dan Kenigsberg danken at redhat.com
Mon Sep 12 15:44:16 UTC 2011


New patch submitted by Dan Kenigsberg (danken at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/914

commit 79befc5ca534a64c6bb5ea9d86066240c446b3b9
Author: Saggi Mizrahi <smizrahi at redhat.com>
Date:   Thu Sep 8 11:27:26 2011 +0300

    Related to BZ#723579 - OOP Handlers shouldn't print to stdout on failure
    
    Change-Id: I7373f2f463252c8ce6302b123b5d60166aa40d48

diff --git a/vdsm/storage/processPool.py b/vdsm/storage/processPool.py
index 25686a7..5156439 100644
--- a/vdsm/storage/processPool.py
+++ b/vdsm/storage/processPool.py
@@ -225,22 +225,27 @@ def _helperMainLoop(pipe, lifeLine, parentLifelineFD):
     poller.register(lifeLine, 0) # Only SIGERR\SIGHUP
     poller.register(pipe.fileno(), select.EPOLLIN | select.EPOLLPRI)
 
-    while True:
+    try:
+        while True:
 
-        for (fd, event) in poller.poll():
-            # If something happened in lifeLine, it means that papa is gone
-            # and we should go as well
-            if fd == lifeLine or event in (select.EPOLLHUP, select.EPOLLERR):
-                return
-
-        func, args, kwargs = pipe.recv()
-        res = err = None
-        try:
-            res = func(*args, **kwargs)
-        except KeyboardInterrupt as ex:
-            err = ex
-        except Exception as ex:
-            err = ex
+            for (fd, event) in poller.poll():
+                # If something happened in lifeLine, it means that papa is gone
+                # and we should go as well
+                if fd == lifeLine or event in (select.EPOLLHUP, select.EPOLLERR):
+                    return
 
-        pipe.send((res, err))
+            func, args, kwargs = pipe.recv()
+            res = err = None
+            try:
+                res = func(*args, **kwargs)
+            except KeyboardInterrupt as ex:
+                err = ex
+            except Exception as ex:
+                err = ex
+
+            pipe.send((res, err))
+    except:
+        # If for some reason communication with the host failed crash silently
+        # There is no logging in oop and VDSM will handle it.
+        pass
 




More information about the vdsm-patches mailing list