Commit dd581c8c authored by Jim Fulton's avatar Jim Fulton

Removed a needless timeout to a condition wait call. Using timeouts

can cause signidficant delays, especially on systems with very
course-grained sleeps, like most linux systems.  This change makes the
ZEO tests run about 25% faster on an Ubuntu desktop system.  We
suspect the production impact to be much greater, at least on some
systems.

Removed some non-async code, now that we no-longer have a non-async
mode. (I cowardly left an assert behind to make sure.:)
parent 7a22c5b8
......@@ -439,6 +439,9 @@ class Connection(smac.SizedMessageAsyncConnection, object):
self.closed = True
self.__super_close()
self.close_trigger()
self.replies_cond.acquire()
self.replies_cond.notifyAll()
self.replies_cond.release()
def close_trigger(self):
# Overridden by ManagedClientConnection.
......@@ -733,24 +736,8 @@ class Connection(smac.SizedMessageAsyncConnection, object):
self.log("wait(%d): reply=%s" %
(msgid, short_repr(reply)), level=TRACE)
return reply
if self.is_async():
self.replies_cond.wait(10.0)
else:
self.replies_cond.release()
try:
try:
if __debug__:
self.log("wait(%d): asyncore.poll(%s)" %
(msgid, delay), level=TRACE)
asyncore.poll(delay, self._singleton)
if delay < 1.0:
delay += delay
except select.error, err:
self.log("Closing. asyncore.poll() raised %s."
% err, level=BLATHER)
self.close()
finally:
self.replies_cond.acquire()
assert self.is_async() # XXX we're such cowards
self.replies_cond.wait()
finally:
self.replies_cond.release()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment