[NEW PATCH] BZ#732914 Default signals handlers in processPool (via gerrit-bot)

Federico Simoncelli fsimonce at redhat.com
Wed Sep 7 10:57:16 UTC 2011


New patch submitted by Federico Simoncelli (fsimonce at redhat.com)

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

commit f3cfb0ecc3232cd9afc19472bdeaf3e21550c165
Author: Federico Simoncelli <fsimonce at redhat.com>
Date:   Wed Sep 7 09:12:13 2011 +0000

    BZ#732914 Default signals handlers in processPool
    
    Change-Id: I493684e3b1159277e3ca2d378d985360c408dc50

diff --git a/vdsm/storage/processPool.py b/vdsm/storage/processPool.py
index 2a2d364..24347ad 100644
--- a/vdsm/storage/processPool.py
+++ b/vdsm/storage/processPool.py
@@ -156,6 +156,13 @@ class Helper(object):
 def _helperMainLoop(pipe, lifeLine, parentLifelineFD):
     os.close(parentLifelineFD)
 
+    # Restoring signal handlers that might deadlock on prepareForShutdown
+    # in the children.
+    # This must be improved using pthread_sigmask before forking so that
+    # we don't risk to have a race condition.
+    for signum in (signal.SIGTERM, signal.SIGUSR1):
+        signal.signal(signum, signal.SIG_DFL)
+
     # Removing all the handlers from the loggers. This avoid a deadlock on
     # the logging locks. Multi-process and multi-threading don't mix well.
     #   - BZ#732652: https://bugzilla.redhat.com/show_bug.cgi?id=732652




More information about the vdsm-patches mailing list