[Zodb-checkins] CVS: ZODB3/ZEO/zrpc - connection.py:1.29

Guido van Rossum guido@python.org
Tue, 17 Sep 2002 17:17:56 -0400


Update of /cvs-repository/ZODB3/ZEO/zrpc
In directory cvs.zope.org:/tmp/cvs-serv20176

Modified Files:
	connection.py 
Log Message:
Remove the code from call() (and wait()) that serialized outgoing
calls.  If multiple threads sharing a ZEO connection want to make
overlapping calls, they can do that now.  This is mostly useful when
one thread is waiting for a long-running pack() or undo*() call -- the
other thread can now proceed.

Jeremy & I did a review of the StorageServer code and found no place
where overlapping incoming calls from the same connection could do any
harm -- given that the only places where incoming calls can be handled
are those places where the server makes a callback to the client.


=== ZODB3/ZEO/zrpc/connection.py 1.28 => 1.29 ===
--- ZODB3/ZEO/zrpc/connection.py:1.28	Tue Sep 17 17:07:00 2002
+++ ZODB3/ZEO/zrpc/connection.py	Tue Sep 17 17:17:55 2002
@@ -306,18 +306,9 @@
         return msgid
 
     def call(self, method, *args):
-        self.__replies_cond.acquire()
-        try:
-            while self.__replies and not self.closed:
-                log("waiting for previous call to finish %s" %
-                    repr(self.__replies.values()[0]))
-                self.__replies_cond.wait(30)
-            if self.closed:
-                raise DisconnectedError()
-            msgid = self.send_call(method, args, 0)
-            self.__replies[msgid] = None
-        finally:
-            self.__replies_cond.release()
+        if self.closed:
+            raise DisconnectedError()
+        msgid = self.send_call(method, args, 0)
         r_flags, r_args = self.wait(msgid)
         if (isinstance(r_args, types.TupleType)
             and type(r_args[0]) == types.ClassType
@@ -367,8 +358,6 @@
                 reply = self.__replies.get(msgid)
                 if reply is not None:
                     del self.__replies[msgid]
-                    assert len(self.__replies) == 0
-                    self.__replies_cond.notifyAll()
                     return reply
                 if self.is_async():
                     self.__replies_cond.wait(10.0)