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

Allow passing --daemonize to workers #4853

Merged
merged 3 commits into from
Mar 15, 2019
Merged

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Mar 13, 2019

This is broadly to make life easier with sytest (c.f. matrix-org/sytest#573)

@erikjohnston erikjohnston marked this pull request as ready for review March 13, 2019 17:39
@erikjohnston erikjohnston requested a review from a team March 13, 2019 17:39
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

This adds a whole bunch of other settings to the --help output:

server:
  -D, --daemonize       Daemonize the home server
  --print-pidfile       Print the path to the pidfile just before daemonizing
  --manhole PORT        Turn on the twisted telnet manhole service on the
                        given port.

database:
  -d SQLITE_DATABASE_PATH, --database-path SQLITE_DATABASE_PATH
                        The path to a sqlite database to use.

logging:
  -v, --verbose         The verbosity level. Specify multiple times to
                        increase verbosity. (Ignored if --log-config is
                        specified.)
  -f LOG_FILE, --log-file LOG_FILE
                        File to log to. (Ignored if --log-config is
                        specified.)
  --log-config LOG_CONFIG
                        Python logging config file
  -n, --no-redirect-stdio
                        Do not redirect stdout/stderr to the log

registration:
  --enable-registration
                        Enable registration for new users.

I don't think that any of the others actually work, so I don't think we should do this.

@codecov
Copy link

codecov bot commented Mar 13, 2019

Codecov Report

Merging #4853 into develop will decrease coverage by 0.01%.
The diff coverage is 33.33%.

@@             Coverage Diff             @@
##           develop    #4853      +/-   ##
===========================================
- Coverage    75.34%   75.32%   -0.02%     
===========================================
  Files          340      340              
  Lines        34939    34953      +14     
  Branches      5722     5727       +5     
===========================================
+ Hits         26324    26328       +4     
- Misses        7000     7008       +8     
- Partials      1615     1617       +2

@erikjohnston
Copy link
Member Author

Good point well made

@erikjohnston
Copy link
Member Author

Okay, this should now correctly handle all the options. There is possibly an argument that we shouldn't support some of them, but we should be consistent across master and workers.

The only thing that is possibly slightly odd here is enable_registration, which will work correctly on servers where we route register to, but is meaningless on other workers. We don't know until we start receiving requests which process will actually handle registration, so I don't think we can asset much at startup.

@erikjohnston erikjohnston requested review from richvdh and a team and removed request for richvdh March 14, 2019 13:36
@@ -28,7 +28,7 @@ def read_config(self, config):
if self.worker_app == "synapse.app.homeserver":
self.worker_app = None

self.worker_listeners = config.get("worker_listeners")
self.worker_listeners = config.get("worker_listeners", [])
Copy link
Member

Choose a reason for hiding this comment

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

this looks like it will fix #4783 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ooh, yes!

Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

lgtm

@erikjohnston erikjohnston merged commit b0fa3f6 into develop Mar 15, 2019
@erikjohnston erikjohnston deleted the erikj/worker_docker_ci branch January 9, 2020 15:51
richvdh added a commit that referenced this pull request Apr 7, 2020
We pass --daemonize on the commandline, which (since at least #4853) overrides
whatever the config file, so there is no need for it to be set in the config
file.
richvdh added a commit that referenced this pull request Apr 8, 2020
We pass --daemonize on the commandline, which (since at least #4853) overrides
whatever the config file, so there is no need for it to be set in the config
file.
phil-flex pushed a commit to phil-flex/synapse that referenced this pull request Jun 16, 2020
We pass --daemonize on the commandline, which (since at least matrix-org#4853) overrides
whatever the config file, so there is no need for it to be set in the config
file.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants