MatrixSynapse/synapse
Sean Quah 772e8c2385
Fix stack overflow in `_PerHostRatelimiter` due to synchronous requests (#14812)
When there are many synchronous requests waiting on a
`_PerHostRatelimiter`, each request will be started recursively just
after the previous request has completed. Under the right conditions,
this leads to stack exhaustion.

A common way for requests to become synchronous is when the remote
client disconnects early, because the homeserver is overloaded and slow
to respond.

Avoid stack exhaustion under these conditions by deferring subsequent
requests until the next reactor tick.

Fixes #14480.

Signed-off-by: Sean Quah <seanq@matrix.org>
2023-01-13 00:16:21 +00:00
..
_scripts Check sqlite database file exists before porting. (#14692) 2022-12-22 13:26:37 -05:00
api Calculate rooms changed for device lists to work. (#14810) 2023-01-11 12:16:41 +00:00
app Add listener `health` (#14747) 2023-01-11 12:00:38 +00:00
appservice
config Re-enable some linting (#14821) 2023-01-12 10:52:07 +00:00
crypto
events Implement MSC3925: changes to bundling of edits (#14811) 2023-01-10 16:31:28 +00:00
federation
handlers Merge remote-tracking branch 'origin/release-v1.75' into develop 2023-01-12 16:45:23 +00:00
http
logging
metrics
module_api Add `set_displayname` to the module API (#14629) 2023-01-11 18:41:52 +00:00
push Remove undocumented device from pushrules (#14727) 2023-01-09 17:17:24 +00:00
replication Batch up replication requests to request the resyncing of remote users's devices. (#14716) 2023-01-10 11:17:59 +00:00
res Fix #11308 : Remove dependency on jquery on reCAPTCHA page (#14672) 2022-12-14 12:02:28 +00:00
rest Fix stack overflow in `_PerHostRatelimiter` due to synchronous requests (#14812) 2023-01-13 00:16:21 +00:00
server_notices
spam_checker_api
state Allow `compute_state_after_events` to use partial state (#14676) 2022-12-14 14:52:35 +00:00
static
storage Merge remote-tracking branch 'origin/release-v1.75' into develop 2023-01-12 16:45:23 +00:00
streams
types Batch up replication requests to request the resyncing of remote users's devices. (#14716) 2023-01-10 11:17:59 +00:00
util Fix stack overflow in `_PerHostRatelimiter` due to synchronous requests (#14812) 2023-01-13 00:16:21 +00:00
__init__.py
event_auth.py Improve validation of field size limits in events. (#14664) 2022-12-13 13:19:19 +00:00
notifier.py
py.typed
server.py Fix stack overflow in `_PerHostRatelimiter` due to synchronous requests (#14812) 2023-01-13 00:16:21 +00:00
visibility.py