Queued can run tasks in a sub-optimal order

Created on 5 February 2024, about 1 year ago
Updated 19 February 2024, about 1 year ago

Problem/Motivation

If you have a lot of tasks in the queue, because the queue runner selects them in batches of 20 and runs then, it means that you can have lots of tasks that are run before others.
For example, if you're using the Hosting task priority sandbox: https://www.drupal.org/sandbox/darthsteven/2730949 then these won't be respected as quickly as they could be.

Given that finding the next task to run is usually going to be much quicker than actually processing the task, it shouldn't be an issue to select the 'next' task to run in batches of 1, instead of 20.

Steps to reproduce

Put lots of tasks into the queue, have some process by which the order of execution changes fairly dynamically.

Proposed resolution

Change the select so that the queued only selects 1 task at a time.

Remaining tasks

Code up the change.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇬🇧United Kingdom steven jones

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024