[Zodb-checkins]
SVN: ZODB/branches/jim-async-client/src/ZEO/zrpc/connection.py
Changed the way connections are closed to pull the
select-loop trigger
Jim Fulton
jim at zope.com
Wed Jul 12 18:00:13 EDT 2006
Log message for revision 69107:
Changed the way connections are closed to pull the select-loop trigger
after closing the socket. This seems to be needed, at least on
Linux to get the close to be observed by the storage. Perhaps the
select loop is actually holding it open in some way.
Also changed _deferred_call to honor async mode.
Changed:
U ZODB/branches/jim-async-client/src/ZEO/zrpc/connection.py
-=-
Modified: ZODB/branches/jim-async-client/src/ZEO/zrpc/connection.py
===================================================================
--- ZODB/branches/jim-async-client/src/ZEO/zrpc/connection.py 2006-07-12 22:00:09 UTC (rev 69106)
+++ ZODB/branches/jim-async-client/src/ZEO/zrpc/connection.py 2006-07-12 22:00:12 UTC (rev 69107)
@@ -354,12 +354,13 @@
return
self._singleton.clear()
self.closed = True
+ self.__super_close()
self.close_trigger()
- self.__super_close()
def close_trigger(self):
# Overridden by ManagedClientConnection.
if self.trigger is not None:
+ self.trigger.pull_trigger()
self.trigger.close()
def register_object(self, obj):
@@ -561,16 +562,16 @@
return r_args
# For testing purposes, it is useful to begin a synchronous call
- # but not block waiting for its response. Since these methods are
- # used for testing they can assume they are not in async mode and
- # call asyncore.poll() directly to get the message out without
- # also waiting for the reply.
+ # but not block waiting for its response.
def _deferred_call(self, method, *args):
if self.closed:
raise DisconnectedError()
msgid = self.send_call(method, args, 0)
- asyncore.poll(0.01, self._singleton)
+ if self.is_async():
+ self.trigger.pull_trigger()
+ else:
+ asyncore.poll(0.01, self._singleton)
return msgid
def _deferred_wait(self, msgid):
@@ -833,9 +834,11 @@
def close_trigger(self):
# We are using a shared trigger for all client connections.
# We never want to close it.
- #del self.trigger
- pass
+ # We do want to pull it to make sure the select loop detects that
+ # we're closed.
+ self.trigger.pull_trigger()
+
def set_async(self, map):
pass
More information about the Zodb-checkins
mailing list