From 46b94140d06df6a19f386d91e00f1756050f94cd Mon Sep 17 00:00:00 2001 From: Sean Quah Date: Mon, 15 Aug 2022 19:28:33 +0100 Subject: [PATCH 1/2] Refuse to start when `faster_joins` is enabled on a worker deployment Synapse does not currently support faster room joins on deployments with workers. Signed-off-by: Sean Quah --- changelog.d/13531.misc | 1 + synapse/app/homeserver.py | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 changelog.d/13531.misc diff --git a/changelog.d/13531.misc b/changelog.d/13531.misc new file mode 100644 index 000000000000..986122d3d089 --- /dev/null +++ b/changelog.d/13531.misc @@ -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. diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 745e7041414f..1eb802371644 100644 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -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 + ): + 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, From e118d0e4ddec559e898f1ca637483cd5be6361c2 Mon Sep 17 00:00:00 2001 From: Sean Quah Date: Tue, 16 Aug 2022 12:01:46 +0100 Subject: [PATCH 2/2] fixup: Move check to generic_worker --- synapse/app/generic_worker.py | 7 +++++++ synapse/app/homeserver.py | 10 ---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py index 42d1f6d21977..30e21d970785 100644 --- a/synapse/app/generic_worker.py +++ b/synapse/app/generic_worker.py @@ -441,6 +441,13 @@ def start(config_options: List[str]) -> None: "synapse.app.user_dir", ) + if config.experimental.faster_joins_enabled: + 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." + ) + synapse.events.USE_FROZEN_DICTS = config.server.use_frozen_dicts synapse.util.caches.TRACK_MEMORY_USAGE = config.caches.track_memory_usage diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 1eb802371644..745e7041414f 100644 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -366,16 +366,6 @@ 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 - ): - 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,