[Zope-Checkins] CVS: Zope/lib/python/Signals - Signals.py:1.3.2.2

Chris McDonough chrism@zope.com
Thu, 10 Oct 2002 10:11:48 -0400


Update of /cvs-repository/Zope/lib/python/Signals
In directory cvs.zope.org:/tmp/cvs-serv28413

Modified Files:
      Tag: Zope-2_6-branch
	Signals.py 
Log Message:
Removed the signal handler hung off USR1 for packing the database.  This feature proved dangerous as the pack operation would happen in the main thread, causing all asyncore operations to stop until it was finished.


=== Zope/lib/python/Signals/Signals.py 1.3.2.1 => 1.3.2.2 ===
--- Zope/lib/python/Signals/Signals.py:1.3.2.1	Tue Oct  8 19:00:17 2002
+++ Zope/lib/python/Signals/Signals.py	Thu Oct 10 10:11:47 2002
@@ -57,6 +57,8 @@
     zLOG.LOG('Z2', zLOG.INFO, "Log files reopened successfully")
 
 def packHandler():
+    """ Packs the main database.  Not safe to call under a signal
+    handler, because it blocks the main thread """
     zLOG.LOG('Z2', zLOG.INFO, 'Packing main ZODB database')
     import Globals
     try:
@@ -85,4 +87,8 @@
     SignalHandler.registerHandler(signal.SIGINT, shutdownHandler)
     SignalHandler.registerHandler(signal.SIGHUP, restartHandler)
     SignalHandler.registerHandler(signal.SIGUSR2, logfileReopenHandler)
-    SignalHandler.registerHandler(signal.SIGUSR1, packHandler)
+    # SIGUSR1 is nominally reserved for pack, but we dont have an
+    # implementation that is stable yet because if the signal handler
+    # fires it will be caught in the main thread and all network operations
+    # will cease until it's finished.
+    #SignalHandler.registerHandler(signal.SIGUSR1, packHandler)