[Zodb-checkins] CVS: StandaloneZODB/ZEO - zrpc2.py:1.3.2.2

Jeremy Hylton jeremy@zope.com
Tue, 15 Jan 2002 12:23:26 -0500


Update of /cvs-repository/StandaloneZODB/ZEO
In directory cvs.zope.org:/tmp/cvs-serv588

Modified Files:
      Tag: Standby-branch
	zrpc2.py 
Log Message:
Make sure triggers are closed.


=== StandaloneZODB/ZEO/zrpc2.py 1.3.2.1 => 1.3.2.2 ===
         self.closed = 0
         self.async = 0
+        self.trigger = None
         # The reply lock is used to block when a synchronous call is
         # waiting for a response
         self.__super_init(sock, addr)
@@ -164,8 +165,13 @@
         if self.closed:
             return
         self.closed = 1
+        self.close_trigger()
         self.__super_close()
 
+    def close_trigger(self):
+        if self.trigger is not None:
+            self.trigger.close()
+
     def register_object(self, obj):
         """Register obj as the true object to invoke methods on"""
         self.obj = obj
@@ -394,6 +400,7 @@
         self.debug = debug
         self.connected = 0
         self.connection = None
+        self.trigger = None
         # If _thread is not None, then there is a helper thread
         # attempting to connect.  _thread is protected by _connect_lock.
         self._thread = None
@@ -441,6 +448,8 @@
     def close(self):
         """Prevent ConnectionManager from opening new connections"""
         self.closed = 1
+        if self.trigger is not None:
+            self.trigger.close()
         self._connect_lock.acquire()
         try:
             if self._thread is not None:
@@ -619,6 +628,10 @@
         else:
             self.__async = None
         self.__super_init(sock, addr, obj)
+
+    def close_trigger(self):
+        # the manager should actually close the trigger
+        del self.trigger
 
     def _prepare_async(self):
         # Don't do the register_loop_callback that the superclass does