element-hq / element-hq/synapse

Synapse doesn't cache keys for remote users that don't have any devices.

Open
#10,151 0 comments 0 reactions 0 assignees View on GitHub
S-Minor T-Defect
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#10151](https://github.com/matrix-org/synapse/issues/10151).

---

This can result in requerying the same keys again and again and again. The root cause here is that we check if we have a cached copy of the keys for the user by looking in `device_lists_remote_cache` table, which only gets populated if the remote user has at least one device.

If a client tries and gets the keys for a lot of such users at once, it can hit the failure mode where the request times out, it retries, and Synapse ends up sitting at 100% CPU just refetching the same user repeatedly, without making any progress.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.