[Zodb-checkins] SVN: ZODB/trunk/src/ZEO/zrpc/connection.py Fixed a trigger leak, introduced when I removed ThreadedAsync, that

Jim Fulton jim at zope.com
Fri Aug 29 08:29:52 EDT 2008


Log message for revision 90578:
  Fixed a trigger leak, introduced when I removed ThreadedAsync, that
  caused an unneeded trigger to be created for each client
  connection. This caused tests hang due to running out of file handles.
  
  Let all server connections share a single trigger to avoid using too
  many file handles in the server.
  

Changed:
  U   ZODB/trunk/src/ZEO/zrpc/connection.py

-=-
Modified: ZODB/trunk/src/ZEO/zrpc/connection.py
===================================================================
--- ZODB/trunk/src/ZEO/zrpc/connection.py	2008-08-29 12:16:07 UTC (rev 90577)
+++ ZODB/trunk/src/ZEO/zrpc/connection.py	2008-08-29 12:29:51 UTC (rev 90578)
@@ -382,8 +382,6 @@
         ourmap = {}
         self.__super_init(sock, addr, map=ourmap)
 
-        self.trigger = trigger()
-
         # The singleton dict is used in synchronous mode when a method
         # needs to call into asyncore to try to force some I/O to occur.
         # The singleton dict is a socket map containing only this object.
@@ -764,12 +762,17 @@
         if __debug__:
             self.log("poll()", level=TRACE)
         self._pull_trigger()
+
+
         
 class ManagedServerConnection(Connection):
     """Server-side Connection subclass."""
     __super_init = Connection.__init__
     __super_close = Connection.close
 
+    # Servers use a shared server trigger that uses the asyncore socket map
+    trigger = trigger()
+
     def __init__(self, sock, addr, obj, mgr):
         self.mgr = mgr
         self.__super_init(sock, addr, obj, 'S')



More information about the Zodb-checkins mailing list