This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
server-key fetching logic is slow and queue-bound #3825
Labels
Comments
This was referenced Sep 7, 2018
This is a huge problem while we are joining a room, and is a huge contributor to #1211. In particular:
|
hawkowl
added
the
z-outbound-federation-meltdown
(Deprecated Label) Synapse melting down by trying to talk to too many servers
label
Jul 11, 2019
This (really the tight looping of |
Merged
DMRobertson
added
A-Federation
and removed
z-federation-meltdown
z-outbound-federation-meltdown
(Deprecated Label) Synapse melting down by trying to talk to too many servers
labels
Aug 25, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
There are a number of problems with the logic in
keyring.py
for fetching server keys:each request that needs a key for a given server gets queued up, and it's possible to end up with quite a long queue for a given server. If the lookup is successful, that's ok. However, if it fails (which may take many minutes while we wait for timeouts), then we try again for each request in the queue - so we can rapidly end up getting very badly behind. When we want key X for server Y, if there is already a request in the queue for that key, then we should just use the results from it, even if it fails.
relatedly, the queueing logic might never complete. If a given request wants keys from server A and server B, and a lookup is already in progress for A, it waits for that to complete. By that time, another request might be doing a lookup for B, so it waits for that to complete. Then we might be waiting for A again. etc. We should immediately start lookups for those servers which aren't already in progress, rather than waiting for the complete set.
see also store_server_verify_keys shouldn't need to lock the table #3819 and get_keys_from_store should do one big lookup, not hundreds of tiny ones #3818
The text was updated successfully, but these errors were encountered: