Skip to content
Snippets Groups Projects
  • Richard van der Hoff's avatar
    d80cd57c
    Fix new scheduled tasks jumping the queue (#17962) · d80cd57c
    Richard van der Hoff authored
    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.
    Fix new scheduled tasks jumping the queue (#17962)
    Richard van der Hoff authored
    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.