Sort jobs of same priority by queuetime
Description
When deciding what lease to give a bot, the SQLDataStore
orders the prospective jobs by priority and takes the first one, and the ordering within the same priority level is unspecified. This may potentially lead to starvation of jobs if there is a steady stream of new work coming in. Address this by also sorting by queued_timestamp
, so that jobs that have been sitting in the queue longer are picked up before newer ones, to give a FIFO like behavior.
This MR fixes #289 (closed)
Edited by Jeremiah Bonney