Skip to content
Snippets Groups Projects
Unverified Commit 772e8c23 authored by Sean Quah's avatar Sean Quah Committed by GitHub
Browse files

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: default avatarSean Quah <seanq@matrix.org>
parent 12083d37
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment