Royce Lv has uploaded a new change for review.

Change subject: integrate zombie reaper in supervdsmServer
......................................................................

integrate zombie reaper in supervdsmServer

Integrate zombie reaper in supervdsmServer
to reclaim the zombie produced by validateAccess.
As python signal handlers only occur between atomic
python intepreter instructions, join thread will result in
SIGCHLD infinite delay.Change it to a timeout join.

Change-Id: Idccc34d8761fb9997cda1184552c6c8f633afbf0
Signed-off-by: Royce Lv<[email protected]>
---
M vdsm/supervdsmServer.py
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/9315/1

diff --git a/vdsm/supervdsmServer.py b/vdsm/supervdsmServer.py
index 34fefdb..33b22b6 100755
--- a/vdsm/supervdsmServer.py
+++ b/vdsm/supervdsmServer.py
@@ -56,6 +56,7 @@
 import ksm
 import mkimage
 from storage.multipath import MPATH_CONF
+import zombieReaper
 
 _UDEV_RULE_FILE_DIR = "/etc/udev/rules.d/"
 _UDEV_RULE_FILE_PREFIX = "99-vdsm-"
@@ -199,6 +200,7 @@
         res, err = pipe.recv()
         pipe.send("Bye")
         proc.terminate()
+        zombieReaper.autoReapPID(proc.pid)
         if err is not None:
             raise err
 
@@ -348,6 +350,8 @@
         if os.path.exists(address):
             os.unlink(address)
 
+        zombieReaper.registerSignalHandler()
+
         log.debug("Setting up keep alive thread")
 
         monThread = threading.Thread(target=__pokeParent,
@@ -369,7 +373,13 @@
                 chown(f, int(uid), METADATA_GROUP)
 
             log.debug("Started serving super vdsm object")
-            servThread.join()
+
+            # Python signal handlers only occur between
+            # "atomic" instructions of the Python interpreter,
+            # periodically join server thread,
+            # to give chance to signal handling
+            while servThread.isAlive():
+                servThread.join(5)
         finally:
             if os.path.exists(address):
                 os.unlink(address)


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

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

Reply via email to