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): ...@@ -382,8 +382,6 @@ class Connection(smac.SizedMessageAsyncConnection, object):
ourmap = {} ourmap = {}
self.__super_init(sock, addr, map=ourmap) self.__super_init(sock, addr, map=ourmap)
self.trigger = trigger()
# The singleton dict is used in synchronous mode when a method # 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. # 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. # The singleton dict is a socket map containing only this object.
...@@ -764,12 +762,17 @@ class Connection(smac.SizedMessageAsyncConnection, object): ...@@ -764,12 +762,17 @@ class Connection(smac.SizedMessageAsyncConnection, object):
if __debug__: if __debug__:
self.log("poll()", level=TRACE) self.log("poll()", level=TRACE)
self._pull_trigger() self._pull_trigger()
class ManagedServerConnection(Connection): class ManagedServerConnection(Connection):
"""Server-side Connection subclass.""" """Server-side Connection subclass."""
__super_init = Connection.__init__ __super_init = Connection.__init__
__super_close = Connection.close __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): def __init__(self, sock, addr, obj, mgr):
self.mgr = mgr self.mgr = mgr
self.__super_init(sock, addr, obj, 'S') 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