diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-12-29 16:14:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-29 16:14:57 +0000 |
commit | 828c58522e3f8d8212edeaf3518e6fcc97a1038d (patch) | |
tree | 6c357cc676b07c401cb8c1191158a9af3bd9b264 /synapse/http/matrixfederationclient.py | |
parent | Bump version and changelog (diff) | |
parent | Manually abort the underlying TLS connection. (diff) | |
download | synapse-828c58522e3f8d8212edeaf3518e6fcc97a1038d.tar.xz |
Merge pull request #1725 from matrix-org/erikj/timeout_conn
Wrap connections in an N minute timeout to ensure they get reaped correctly
Diffstat (limited to 'synapse/http/matrixfederationclient.py')
-rw-r--r-- | synapse/http/matrixfederationclient.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/http/matrixfederationclient.py b/synapse/http/matrixfederationclient.py index d5970c05a8..78b92cef36 100644 --- a/synapse/http/matrixfederationclient.py +++ b/synapse/http/matrixfederationclient.py @@ -88,7 +88,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 ) @@ -299,7 +300,7 @@ class MatrixFederationHttpClient(object): defer.returnValue(json.loads(body)) @defer.inlineCallbacks - def post_json(self, destination, path, data={}, long_retries=True, + def post_json(self, destination, path, data={}, long_retries=False, timeout=None): """ Sends the specifed json data using POST @@ -332,7 +333,7 @@ class MatrixFederationHttpClient(object): path.encode("ascii"), body_callback=body_callback, headers_dict={"Content-Type": ["application/json"]}, - long_retries=True, + long_retries=long_retries, timeout=timeout, ) |