Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Refuse to start when faster_joins is enabled on a worker deployment #13531

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/13531.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faster room joins: Refuse to start when faster joins is enabled on a deployment with workers, since worker configurations are not currently supported.
10 changes: 10 additions & 0 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,16 @@ def setup(config_options: List[str]) -> SynapseHomeServer:
"`enable_registration_without_verification` config option to `true`."
)

if (
config.experimental.faster_joins_enabled
and config.worker.worker_app is not None
):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To check: in a worker deployment, the main process has config.worker.worker_app set to None?

I'm worried that there might be danger in having the main process run some remote-join-aware code, while others are expecting full-join-only. But maybe there isn't an easy way round this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this condition will never be hit I don't think, as synapse.app.homeserver is the entry point for master only.

I'm worried that there might be danger in having the main process run some remote-join-aware code, while others are expecting full-join-only. But maybe there isn't an easy way round this?

I don't think this is an issue as long as we refuse to start up workers, as the only real difference between monolith and worker mode is if there are other workers running.

raise ConfigError(
"You have enabled the experimental `faster_joins` config option, but it is "
"not compatible with worker deployments yet. Please disable `faster_joins` "
"or run Synapse as a single process deployment instead."
)

hs = SynapseHomeServer(
config.server.server_name,
config=config,
Expand Down