-
Notifications
You must be signed in to change notification settings - Fork 402
Move start_doing_background_updates()
to SynapseHomeServer.start_background_tasks()
#19036
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
Move start_doing_background_updates()
to SynapseHomeServer.start_background_tasks()
#19036
Conversation
def start_background_tasks(self) -> None: | ||
super().start_background_tasks() | ||
|
||
self.get_datastores().main.db_pool.updates.start_doing_background_updates() |
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.
The one difference here is that previously, start_doing_background_updates()
only ran on the main Synapse instance.
But start_background_tasks()
runs on the worker that supposed to run_background_tasks
.
Lines 683 to 684 in 47fb4b4
if hs.config.worker.run_background_tasks: | |
hs.start_background_tasks() |
Is that okay? Nothing is immediately coming to mind on why this would be bad.
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.
seems OK to me too
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.
Actually, I think there is a flaw with this setup.
SynapseHomeServer
is for the main Synapse instance. We have SynapseHomeServer.start_background_tasks()
setup to call start_doing_background_updates()
but if the run_background_tasks_on
is set to anything else besides main
, then we will never run SynapseHomeServer.start_background_tasks()
specifically.
What we actually need to do is just move this to HomeServer.start_background_tasks()
instead. We want start_doing_background_updates()
to run on whatever homeserver is configured to run_background_tasks_on
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.
This is being addressed in #19057
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.
Thanks for the review @reivilibre 🦧 |
….start_background_tasks()` (#19036)" (#19059) ### Why See #19036 (comment) Revert while I figure out the tests in #19057
Move
start_doing_background_updates()
toSynapseHomeServer.start_background_tasks()
(more sane standard location for this sort of thing)Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.