This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow background tasks to be run on a separate worker. #8369
Merged
Merged
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
71ade09
Allow background tasks to be run on a separate worker.
clokep 094b11e
Only run function on background worker.
clokep fd8aad3
Accept a worker name instead of using a flag.
clokep 67c6fa4
Remove check for being the background_worker app.
clokep 08a7d5d
Do not allow a non-existent worker app.
clokep 0d06a87
Also run the user directory updating in the backgronud.
clokep 2e98b78
Ensure the proper handlers are loaded during start-up.
clokep b77b89b
Backout some of the changes to simplify the PR.
clokep f26b92e
Ensure that the background tasks have access to the proper stores.
clokep 53a4402
Add some documentation.
clokep 82d167b
Do not require a replication endpoint for the instance map.
clokep 0c9e970
Clarify confusing wording.
clokep d40aff7
Do not require the background worker instance to be in the instance map.
clokep c015379
Update the sample config.
clokep cfe28f2
The user directory background tasks are controlled by a separate flag.
clokep f0c83d9
Rename instance variable.
clokep b226c49
Allow the phone home stats to be able to run on any worker.
clokep cb740cf
Move around some storage classes to make the proper metrics methods a…
clokep 179d8c3
Consolidate logic for starting metrics calls.
clokep 9fb2c05
Merge remote-tracking branch 'origin/develop' into clokep/background-…
clokep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Allow running background tasks in a separate worker process. |
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
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
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
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
Oops, something went wrong.
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.
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.
I wonder if we can move this to somewhere in
synapse.app._base
?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.
Perhaps around
synapse/synapse/app/_base.py
Lines 274 to 275 in c619253
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 only downside of this is that it also gets used for
synapse.app.admin_cmd
. I don't know how frequently this gets run and if it would cause any issues. Thoughts @erikjohnston?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.
Wouldn't the admin command have the
run_background_tasks
disabled?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.
Ah, there's a section to disable all background tasks anyway, so looks like I should add that there.