anonymousland-synapse/synapse/rest/client
Sean Quah 772e8c2385
Fix stack overflow in _PerHostRatelimiter due to synchronous requests ()
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 .

Signed-off-by: Sean Quah <seanq@matrix.org>
2023-01-13 00:16:21 +00:00
..
__init__.py Flatten the synapse.rest.client package () 2021-08-17 11:57:58 +00:00
_base.py Add support for /_matrix/client/v3 APIs () 2021-11-16 14:47:58 +01:00
account_data.py Add experimental support for MSC3391: deleting account data () 2023-01-01 03:40:46 +00:00
account_validity.py Addtional type hints for the REST servlets. () 2021-08-23 08:14:17 -04:00
account.py Disable sending confirmation email when 3pid is disabled () 2023-01-09 11:12:03 +00:00
auth.py Use getClientAddress instead of getClientIP. () 2022-05-04 14:11:21 -04:00
capabilities.py Implementation for MSC3664: Pushrules for relations () 2022-10-25 14:38:01 +01:00
devices.py Use ClientRestResource on both the main process and workers. () 2022-12-02 13:10:05 -05:00
directory.py Use Pydantic when PUTting room aliases () 2022-10-17 13:39:12 +01:00
events.py Do not allow a None-limit on PaginationConfig. () 2022-10-14 12:30:05 +00:00
filter.py Use direct references for configuration variables (part 6). () 2021-09-29 06:44:15 -04:00
initial_sync.py Do not allow a None-limit on PaginationConfig. () 2022-10-14 12:30:05 +00:00
keys.py Use ClientRestResource on both the main process and workers. () 2022-12-02 13:10:05 -05:00
knock.py Use ParamSpec in a few places () 2022-05-09 10:27:39 +00:00
login_token_request.py Save login tokens in database () 2022-10-26 11:45:41 +01:00
login.py Remove redundant types from comments. () 2022-11-16 15:25:24 +00:00
logout.py Add a type hint for get_device_handler() and fix incorrect types. () 2022-11-22 14:08:04 -05:00
models.py A third batch of Pydantic validation for rest/client/account.py () 2022-09-15 18:36:02 +01:00
mutual_rooms.py Mutual rooms: Remove dependency on user directory () 2022-05-30 10:05:31 +01:00
notifications.py Remove support for unstable private read receipts () 2022-09-01 13:31:54 +01:00
openid.py Remove HomeServer.get_datastore() () 2022-02-23 11:04:02 +00:00
password_policy.py Use direct references for some configuration variables (part 3) () 2021-09-23 07:13:34 -04:00
presence.py Additional type hints for REST servlets (part 2). () 2021-08-26 11:53:52 +00:00
profile.py synapse.api.auth.Auth cleanup: make permission-related methods use Requester instead of the UserID () 2022-08-22 14:17:59 +01:00
push_rule.py Add some type hints to datastore () 2022-05-17 15:29:06 +01:00
pusher.py Track device IDs for pushers () 2022-09-21 15:31:53 +00:00
read_marker.py Accept & store thread IDs for receipts (implement MSC3771). () 2022-09-23 14:33:28 +00:00
receipts.py Reject receipt requests with invalid room or event IDs. () 2022-12-07 17:35:41 +00:00
register.py Fix stack overflow in _PerHostRatelimiter due to synchronous requests () 2023-01-13 00:16:21 +00:00
relations.py Stabilize the threads API. () 2022-10-14 07:16:50 -04:00
rendezvous.py Implementation of HTTP 307 response for MSC3886 POST endpoint () 2022-10-18 15:52:25 +00:00
report_event.py Remove HomeServer.get_datastore() () 2022-02-23 11:04:02 +00:00
room_batch.py Reject history insertion during partial joins () 2022-10-27 10:52:23 +01:00
room_keys.py Add type annotations to trace decorator. () 2022-07-19 14:14:30 -04:00
room_upgrade_rest_servlet.py Addtional type hints for the REST servlets. () 2021-08-23 08:14:17 -04:00
room.py Move StateFilter to synapse.types () 2022-12-12 16:19:30 +00:00
sendtodevice.py Improve logging and opentracing for to-device message handling () 2022-12-06 09:52:55 +00:00
sync.py Return NOT_JSON if decode fails and defer set_timeline_upper_limit ca… () 2022-10-24 16:55:06 +01:00
tags.py Remove HomeServer.get_datastore() () 2022-02-23 11:04:02 +00:00
thirdparty.py Addtional type hints for the REST servlets. () 2021-08-23 08:14:17 -04:00
tokenrefresh.py Addtional type hints for the REST servlets. () 2021-08-23 08:14:17 -04:00
transactions.py Use ParamSpec in a few places () 2022-05-09 10:27:39 +00:00
user_directory.py Fix a long-standing bug where the user directory would return 1 more row than requested. () 2022-12-07 11:19:43 +00:00
versions.py Advertise support for Matrix v1.5. () 2022-11-29 10:49:23 -05:00
voip.py Fix getTurnServer response: return an integer ttl () 2021-09-30 08:04:55 -04:00