synapse/tests/module_api
Quentin Gliech 5ea2cf2484
Move device changes off the main process (#18581)
The main goal of this PR is to handle device list changes onto multiple
writers, off the main process, so that we can have logins happening
whilst Synapse is rolling-restarting.

This is quite an intrusive change, so I would advise to review this
commit by commit; I tried to keep the history as clean as possible.

There are a few things to consider:

- the `device_list_key` in stream tokens becomes a
`MultiWriterStreamToken`, which has a few implications in sync and on
the storage layer
- we had a split between `DeviceHandler` and `DeviceWorkerHandler` for
master vs. worker process. I've kept this split, but making it rather
writer vs. non-writer worker, using method overrides for doing
replication calls when needed
- there are a few operations that need to happen on a single worker at a
time. Instead of using cross-worker locks, for now I made them run on
the first writer on the list

---------

Co-authored-by: Eric Eastwood <erice@element.io>
2025-07-18 09:06:14 +02:00
..
__init__.py Wrap register_device coroutine in an ensureDeferred (#7684) 2020-06-16 10:13:59 +01:00
test_account_data_manager.py Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
test_api.py Move device changes off the main process (#18581) 2025-07-18 09:06:14 +02:00
test_event_unsigned_addition.py Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
test_spamchecker.py Add user_may_send_state_event callback to spam checker module API (#18455) 2025-06-04 11:26:04 +00:00