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.
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
Is that okay? Nothing is immediately coming to mind on why this would be bad.
There was a problem hiding this comment.
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
|
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
EventStoretoEventWorkerStore.".code blocks.