forked-synapse/synapse/util
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
..
caches Add missing type hints to tests.config. (#14681) 2022-12-16 08:53:28 -05:00
__init__.py Always close _all_ ijson coroutines, even if doing so raises Exceptions (#14065) 2022-10-06 18:17:50 +00:00
async_helpers.py Batch up replication requests to request the resyncing of remote users's devices. (#14716) 2023-01-10 11:17:59 +00:00
batching_queue.py
cancellation.py Generalise the @cancellable annotation so it can be used on functions other than just servlet methods. (#13662) 2022-08-31 11:16:05 +00:00
check_dependencies.py Don't require setuptools_rust at runtime (#13952) 2022-09-29 20:16:08 +00:00
daemonize.py
distributor.py
file_consumer.py
frozenutils.py
gai_resolver.py
hash.py
httpresourcetree.py Respond with proper error responses on unknown paths. (#14621) 2022-12-08 11:37:05 -05:00
iterutils.py
linked_list.py
logcontext.py
logformatter.py
macaroons.py Support RFC7636 PKCE in the OAuth 2.0 flow. (#14750) 2023-01-04 14:58:08 -05:00
manhole.py
metrics.py Fix a memory leak when running the unit tests. (#13798) 2022-09-14 15:29:05 +00:00
module_loader.py
msisdn.py
patch_inline_callbacks.py
ratelimitutils.py Fix stack overflow in _PerHostRatelimiter due to synchronous requests (#14812) 2023-01-13 00:16:21 +00:00
retryutils.py Refactor MSC3030 /timestamp_to_event to move away from our snowflake pull from destination pattern (#14096) 2022-10-26 16:10:55 -05:00
rlimit.py
rust.py Check if Rust lib needs rebuilding. (#13759) 2022-09-12 10:03:42 +00:00
stringutils.py Making parse_server_name more consistent (#14007) 2022-10-11 12:42:11 +00:00
templates.py
threepids.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00
wheel_timer.py Remove redundant types from comments. (#14412) 2022-11-16 15:25:24 +00:00