Split loading config vs homeserver setup#18933
Merged
MadLittleMods merged 6 commits intoSep 22, 2025
Merged
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 ```
MadLittleMods
commented
Sep 17, 2025
| Supports generation of config files, so is used for the main homeserver app. | ||
|
|
||
| Args: | ||
| description: TODO |
Contributor
Author
There was a problem hiding this comment.
Prior art, something to do in the future
MadLittleMods
commented
Sep 17, 2025
Comment on lines
+428
to
430
| homeserver_config = load_or_generate_config(sys.argv[1:]) | ||
|
|
||
| with LoggingContext("main"): |
Contributor
Author
There was a problem hiding this comment.
To make things more clear, with #18868, this will look like the following in the future:
Suggested change
| 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): |
MadLittleMods
commented
Sep 17, 2025
|
|
||
| Args: | ||
| config_options_options: The options passed to Synapse. Usually `sys.argv[1:]`. | ||
| argv_options: The options passed to Synapse. Usually `sys.argv[1:]`. |
Contributor
Author
There was a problem hiding this comment.
I've renamed this to be argv_options given we expect to be passed everything after the executable name in the argv list.
reivilibre
approved these changes
Sep 22, 2025
Conflicts: synapse/app/generic_worker.py
Contributor
Author
|
Thanks for the review @reivilibre 🦫 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split loading config vs homeserver
setupThis allows us to get access to
server_nameso 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
EventStoretoEventWorkerStore.".code blocks.