MatrixSynapse/synapse/handlers
Richard van der Hoff 1c262431f9
Fix handling of connection timeouts in outgoing http requests (#8400)
* Remove `on_timeout_cancel` from `timeout_deferred`

The `on_timeout_cancel` param to `timeout_deferred` wasn't always called on a
timeout (in particular if the canceller raised an exception), so it was
unreliable. It was also only used in one place, and to be honest it's easier to
do what it does a different way.

* Fix handling of connection timeouts in outgoing http requests

Turns out that if we get a timeout during connection, then a different
exception is raised, which wasn't always handled correctly.

To fix it, catch the exception in SimpleHttpClient and turn it into a
RequestTimedOutError (which is already a documented exception).

Also add a description to RequestTimedOutError so that we can see which stage
it failed at.

* Fix incorrect handling of timeouts reading federation responses

This was trapping the wrong sort of TimeoutError, so was never being hit.

The effect was relatively minor, but we should fix this so that it does the
expected thing.

* Fix inconsistent handling of `timeout` param between methods

`get_json`, `put_json` and `delete_json` were applying a different timeout to
the response body to `post_json`; bring them in line and test.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Co-authored-by: Erik Johnston <erik@matrix.org>
2020-09-29 10:29:21 +01:00
..
ui_auth
__init__.py
_base.py
account_data.py
account_validity.py
acme.py
acme_issuing_service.py
admin.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
appservice.py
auth.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
cas_handler.py
deactivate_account.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
device.py Create function to check for long names in devices (#8364) 2020-09-22 11:42:55 +01:00
devicemessage.py
directory.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
e2e_keys.py
e2e_room_keys.py
events.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
federation.py A pair of tiny cleanups in the federation request code. (#8401) 2020-09-28 13:15:00 +01:00
groups_local.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
identity.py Fix handling of connection timeouts in outgoing http requests (#8400) 2020-09-29 10:29:21 +01:00
initial_sync.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
message.py Add EventStreamPosition type (#8388) 2020-09-24 13:24:17 +01:00
oidc_handler.py Allow existing users to login via OpenID Connect. (#8345) 2020-09-25 07:01:45 -04:00
pagination.py Fix a bad merge from release-v1.20.0. (#8354) 2020-09-18 12:54:04 -04:00
password_policy.py
presence.py
profile.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
read_marker.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
receipts.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
register.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
room.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
room_list.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
room_member.py
room_member_worker.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
saml_handler.py
search.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
set_password.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00
state_deltas.py
stats.py
sync.py Add EventStreamPosition type (#8388) 2020-09-24 13:24:17 +01:00
typing.py
user_directory.py Simplify super() calls to Python 3 syntax. (#8344) 2020-09-18 09:56:44 -04:00