Commit e470d940 authored by Vincent Pelletier's avatar Vincent Pelletier

Move as much code as possible outside of critical section.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1712 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 96bce54f
...@@ -50,15 +50,15 @@ class IdleEvent(object): ...@@ -50,15 +50,15 @@ class IdleEvent(object):
# No answer after _critical_time, close connection. # No answer after _critical_time, close connection.
# This means that remote peer is processing the request for too # This means that remote peer is processing the request for too
# long, although being responsive at network level. # long, although being responsive at network level.
logging.info('timeout for %r with %s:%d',
self._id, *(conn.getAddress()))
conn.lock() conn.lock()
try: try:
logging.info('timeout for %r with %s:%d',
self._id, *(conn.getAddress()))
conn.close() conn.close()
conn.getHandler().timeoutExpired(conn) conn.getHandler().timeoutExpired(conn)
return True
finally: finally:
conn.unlock() conn.unlock()
return True
elif t > self._time: elif t > self._time:
# Still no answer after _time, send a ping to see if connection is # Still no answer after _time, send a ping to see if connection is
# broken. # broken.
......
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