synapse/synapse
Andrew Morgan 3e58ce72b4
Don't bother responding to client requests that have already disconnected (#8465)
This PR ports the quick fix from https://github.com/matrix-org/synapse/pull/2796 to further methods which handle media, URL preview and `/key/v2/server` requests. This prevents a harmless `ERROR` that comes up in the logs when we were unable to respond to a client request when the client had already disconnected. In this case we simply bail out if the client has already done so.

This is the 'simple fix' as suggested by https://github.com/matrix-org/synapse/issues/5304#issuecomment-574740003.

Fixes https://github.com/matrix-org/synapse/issues/6700
Fixes https://github.com/matrix-org/synapse/issues/5304
2020-10-06 10:03:39 +01:00
..
_scripts Remove obsolete __future__ imports (#8337) 2020-09-17 08:37:01 -04:00
api Do not assume that account data is of the correct form. (#8454) 2020-10-05 09:28:05 -04:00
app Add logging on startup/shutdown (#8448) 2020-10-02 15:20:45 +01:00
appservice Add type annotations to SimpleHttpClient (#8372) 2020-09-24 15:47:20 +01:00
config Update default room version to 6 (#8461) 2020-10-05 21:40:51 +01:00
crypto Fix occasional "Re-starting finished log context" from keyring (#8398) 2020-09-25 12:29:54 +01:00
events Allow ThirdPartyEventRules modules to manipulate public room state (#8292) 2020-10-05 14:57:46 +01:00
federation Remove stream ordering from Metadata dict (#8452) 2020-10-05 14:43:14 +01:00
groups Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
handlers Allow ThirdPartyEventRules modules to manipulate public room state (#8292) 2020-10-05 14:57:46 +01:00
http Don't bother responding to client requests that have already disconnected (#8465) 2020-10-06 10:03:39 +01:00
logging Enable mypy checking for unreachable code and fix instances. (#8432) 2020-10-01 08:09:18 -04:00
metrics Rewrite BucketCollector 2020-09-30 16:49:15 +01:00
module_api Allow ThirdPartyEventRules modules to manipulate public room state (#8292) 2020-10-05 14:57:46 +01:00
push Enable mypy checking for unreachable code and fix instances. (#8432) 2020-10-01 08:09:18 -04:00
replication Add unit test for event persister sharding (#8433) 2020-10-02 09:57:12 +01:00
res/templates Convert additional templates to Jinja (#8444) 2020-10-02 11:15:53 +01:00
rest Don't bother responding to client requests that have already disconnected (#8465) 2020-10-06 10:03:39 +01:00
server_notices Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
spam_checker_api Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
state Enable mypy checking for unreachable code and fix instances. (#8432) 2020-10-01 08:09:18 -04:00
static Clean-up the fallback login code. (#7657) 2020-06-10 09:50:39 -04:00
storage Remove stream ordering from Metadata dict (#8452) 2020-10-05 14:43:14 +01:00
streams Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
util Expose a get_resource_usage method in Measure 2020-09-29 17:35:20 +01:00
__init__.py 1.21.0rc2 2020-10-02 12:46:58 +01:00
event_auth.py Ensure that event.redacts is the proper type before handling it (#8457) 2020-10-05 10:24:17 -04:00
notifier.py Various clean ups to room stream tokens. (#8423) 2020-09-29 21:48:33 +01:00
python_dependencies.py Drop support for ancient prometheus_client (#8426) 2020-09-30 16:42:05 +01:00
secrets.py Stop sub-classing object (#8249) 2020-09-04 06:54:56 -04:00
server.py Allow background tasks to be run on a separate worker. (#8369) 2020-10-02 08:23:15 -04:00
types.py Make token serializing/deserializing async (#8427) 2020-09-30 20:29:19 +01:00
visibility.py Do not assume that account data is of the correct form. (#8454) 2020-10-05 09:28:05 -04:00