Skip to content
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

Remove the concept of worker "types" #10441

Open
2 of 6 tasks
matrixbot opened this issue Dec 18, 2023 · 0 comments
Open
2 of 6 tasks

Remove the concept of worker "types" #10441

matrixbot opened this issue Dec 18, 2023 · 0 comments

Comments

@matrixbot
Copy link
Collaborator

matrixbot commented Dec 18, 2023

This issue has been migrated from #10441.


We're currently midway through the process of fading out the concept of different types for a Synapse worker process. For example synapse.app.pusher, synapse.app.federation_sender etc. While initially this provided a quick way to configure a worker to perform certain actions, it is also rather confusing and the inability to specify multiple types per worker can limit the flexibility of deployment.

For instance, it's currently not possible to configure a worker to both send events to appservices (synapse.app.appservice) and update the user directory tables (synapse.app.user_dir), as the functionality is forcefully disabled unless the worker is specifically marked as each respective type:

https://github.com/matrix-org/synapse/blob/85d237eba789a667109ced140026d2494b210310/synapse/app/generic_worker.py#L433-L463

Instead, workers should be configured via worker file config options, so that one could simply set notify_appservices: true and update_user_directory: true in the worker config to enable the worker to handle both sets of tasks.

As many worker deployments currently rely on the worker_type configuration, a deprecation period is necessary. A rough plan for carrying this out could look like:

  • Allow all current worker configurations through config file values alone.
  • Announce a deprecation period for the worker_type config option.
  • After some time, remove the worker_type config option. All workers are now a "generic worker", though this term is no longer a necessary distinction.

In the short term, the first step would allow for more immediate flexibility for medium-sized deployments - which need to move tasks off the main process, but don't have the resources to spin up a separate worker for each type.

Superseded worker types so far

  • synapse.app.appservice Dummy issue #12452
  • synapse.app.user_dir Dummy issue #12654
  • synapse.app.pusher
  • synapse.app.federation_sender
  • synapse.app.media_repository
  • synapse.app.frontend_proxy
@matrixbot matrixbot changed the title Dummy issue Remove the concept of worker "types" Dec 21, 2023
@matrixbot matrixbot reopened this Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant