mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Wrap connections in an N minute timeout to ensure they get reaped correctly
This commit is contained in:
parent
f5a4001bb1
commit
5b6672c66d
2 changed files with 61 additions and 5 deletions
|
@ -61,6 +61,11 @@ MAX_LONG_RETRIES = 10
|
|||
MAX_SHORT_RETRIES = 3
|
||||
|
||||
|
||||
def test(conn):
|
||||
conn.loseConnection()
|
||||
return conn
|
||||
|
||||
|
||||
class MatrixFederationEndpointFactory(object):
|
||||
def __init__(self, hs):
|
||||
self.tls_server_context_factory = hs.tls_server_context_factory
|
||||
|
@ -88,7 +93,8 @@ class MatrixFederationHttpClient(object):
|
|||
self.signing_key = hs.config.signing_key[0]
|
||||
self.server_name = hs.hostname
|
||||
pool = HTTPConnectionPool(reactor)
|
||||
pool.maxPersistentPerHost = 10
|
||||
pool.maxPersistentPerHost = 5
|
||||
pool.cachedConnectionTimeout = 2 * 60
|
||||
self.agent = Agent.usingEndpointFactory(
|
||||
reactor, MatrixFederationEndpointFactory(hs), pool=pool
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue