From 70cbb1a5e311f609b624e3fae1a1712db639c51e Mon Sep 17 00:00:00 2001 From: Shay Date: Tue, 30 Nov 2021 10:12:18 -0800 Subject: Don't start Synapse master process if `worker_app` is set (#11416) * Add check to catch syanpse master process starting when workers are configured * add test to verify that starting master process with worker config raises error * newsfragment * specify config.worker.worker_app in check * update test * report specific config option that triggered the error Co-authored-by: reivilibre * clarify error message Co-authored-by: reivilibre Co-authored-by: reivilibre --- synapse/app/homeserver.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'synapse/app/homeserver.py') diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py index 52541faab2..dd76e07321 100644 --- a/synapse/app/homeserver.py +++ b/synapse/app/homeserver.py @@ -358,6 +358,13 @@ def setup(config_options: List[str]) -> SynapseHomeServer: # generating config files and shouldn't try to continue. sys.exit(0) + if config.worker.worker_app: + raise ConfigError( + "You have specified `worker_app` in the config but are attempting to start a non-worker " + "instance. Please use `python -m synapse.app.generic_worker` instead (or remove the option if this is the main process)." + ) + sys.exit(1) + events.USE_FROZEN_DICTS = config.server.use_frozen_dicts synapse.util.caches.TRACK_MEMORY_USAGE = config.caches.track_memory_usage -- cgit 1.4.1