-
Notifications
You must be signed in to change notification settings - Fork 392
Split loading config vs homeserver setup
#18933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split loading config vs homeserver setup
#18933
Conversation
This allows us to get access to `server_name` before which we may want to use in the `with LoggingContext("main"):` call early on. This also allows us more flexibility to parse config however we want and setup a Synapse homeserver. Like what we do in Synapse Pro for Small Hosts.
Changes from 3a5bab7 ``` git checkout 3a5bab7 -- synapse/app/admin_cmd.py synapse/app/appservice.py synapse/app/client_reader.py synapse/app/event_creator.py synapse/app/federation_reader.py synapse/app/federation_sender.py synapse/app/frontend_proxy.py synapse/app/generic_worker.py synapse/app/media_repository.py synapse/app/pusher.py synapse/app/synchrotron.py synapse/app/user_dir.py ```
Supports generation of config files, so is used for the main homeserver app. | ||
Args: | ||
description: TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prior art, something to do in the future
homeserver_config = load_or_generate_config(sys.argv[1:]) | ||
|
||
with LoggingContext("main"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make things more clear, with #18868, this will look like the following in the future:
homeserver_config = load_or_generate_config(sys.argv[1:]) | |
with LoggingContext("main"): | |
homeserver_config = load_or_generate_config(sys.argv[1:]) | |
with LoggingContext(name="main", server_name=homeserver_config.server.server_name): |
Args: | ||
config_options_options: The options passed to Synapse. Usually `sys.argv[1:]`. | ||
argv_options: The options passed to Synapse. Usually `sys.argv[1:]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've renamed this to be argv_options
given we expect to be passed everything after the executable name in the argv
list.
Conflicts: synapse/app/generic_worker.py
Thanks for the review @reivilibre 🦫 |
Split loading config vs homeserver
setup
This allows us to get access to
server_name
so we can use it when creating theLoggingContext("main")
in the future (pre-requisite for #18868).This also allows us more flexibility to parse config however we want and setup a Synapse homeserver. Like what we do in Synapse Pro for Small Hosts.
Split out from #18868
Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.