summary refs log tree commit diff
path: root/synapse/util/task_scheduler.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Wording improvements for the `TaskScheduler` (#17992)Andrew Morgan2024-12-181-37/+53
| | | | As I found the current docstrings a bit unclear while trying to wrap my head around this class.
* Fix new scheduled tasks jumping the queue (#17962)Richard van der Hoff2024-11-281-33/+32
| | | | | | | | | | | | Currently, when a new scheduled task is added and its scheduled time has already passed, we set it to ACTIVE. This is problematic, because it means it will jump the queue ahead of all other SCHEDULED tasks; furthermore, if the Synapse process gets restarted, it will jump ahead of any ACTIVE tasks which have been started but are taking a while to run. Instead, we leave it set to SCHEDULED, but kick off a call to `_launch_scheduled_tasks`, which will decide if we actually have capacity to start a new task, and start the newly-added task if so.
* Add logging to tasks managed by the task scheduler, showing CPU and database ↵reivilibre2024-05-221-2/+67
| | | | | | | | | | | | | | | | | | | usage. (#17219) The log format is the same as the request log format, except: - fields that are specific to HTTP requests have been removed - the task's params are included at the end of the log line. These log lines are emitted: - when the task function finishes — both completion and failure (and I suppose it is possible for a task to become schedulable again?) - every 5 minutes whilst it is running Closes #17217. --------- Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
* Correctly mention previous copyright (#16820)Erik Johnston2024-01-231-0/+1
| | | | | During the migration the automated script to update the copyright headers accidentally got rid of some of the existing copyright lines. Reinstate them.
* Update license headersPatrick Cloke2023-11-211-10/+16
|
* Speed up how quickly we launch new tasks (#16660)Erik Johnston2023-11-171-1/+1
| | | Now that we're reducing concurrency (#16656), this is more important.
* Reduce task concurrency (#16656)Erik Johnston2023-11-171-1/+1
|
* Speed up deleting device messages (#16643)Erik Johnston2023-11-161-1/+1
| | | Keeping track of a lower bound of stream ID where we've deleted everything below makes the queries much faster. Otherwise, every time we scan for rows to delete we'd re-scan across all the rows that have previously deleted (until the next table VACUUM).
* Some minor performance fixes for task schedular (#16313)Erik Johnston2023-09-141-30/+70
|
* Fix bug with new task scheduler using lots of CPU. (#16278)Erik Johnston2023-09-081-21/+22
| | | | | Using the new `TaskScheduler` meant that we'ed create lots of new metrics (due to adding task ID to the desc of background process), resulting in requests for metrics taking an increasing amount of CPU.
* Delete device messages asynchronously and in staged batches (#16240)Mathieu Velten2023-09-061-10/+7
|
* Task scheduler: add replication notify for new task to launch ASAP (#16184)Mathieu Velten2023-08-281-49/+43
|
* Task scheduler: mark task as active if we are scheduling ASAP (#16165)Mathieu Velten2023-08-231-1/+3
|
* Implements a task scheduler for resumable potentially long running tasks ↵Mathieu Velten2023-08-211-0/+364
(#15891)