Commit 32d29360 authored by Jim Fulton's avatar Jim Fulton

Fixed a trigger leak, introduced when I removed ThreadedAsync, that

caused an unneeded trigger to be created for each client
connection. This caused tests hang due to running out of file handles.

Let all server connections share a single trigger to avoid using too
many file handles in the server.
parent 28e2ea9e
......@@ -382,8 +382,6 @@ class Connection(smac.SizedMessageAsyncConnection, object):
ourmap = {}
self.__super_init(sock, addr, map=ourmap)
self.trigger = trigger()
# The singleton dict is used in synchronous mode when a method
# needs to call into asyncore to try to force some I/O to occur.
# The singleton dict is a socket map containing only this object.
......@@ -765,11 +763,16 @@ class Connection(smac.SizedMessageAsyncConnection, object):
self.log("poll()", level=TRACE)
self._pull_trigger()
class ManagedServerConnection(Connection):
"""Server-side Connection subclass."""
__super_init = Connection.__init__
__super_close = Connection.close
# Servers use a shared server trigger that uses the asyncore socket map
trigger = trigger()
def __init__(self, sock, addr, obj, mgr):
self.mgr = mgr
self.__super_init(sock, addr, obj, 'S')
......
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