Skip to content
Commit fa8fb519 authored by Phil Dawson's avatar Phil Dawson
Browse files

scheduler.py: Prioritise jobs from later queues

Previously, we were reversing the order of queues in
_schedule_queue_jobs() in an attempt to avoid resource starvation of
queues which share resource types. This was incorrect as the earlier
jobs were still ready first and so were scheduled first.

Instead we schedule jobs starting from the most recently ready. This
will mean that queues later in the scheduling process will always have
priority when they share a resource type with another queue.

This also fixes a bug in _sched() arising from the fact we were
removing items from waiting_jobs while iterating through it.
Aside from resulting in the loop having an O(n^2) complexity, this
results in skipping the job following the removed item in the
iteration.

This commit is related to issue #712
parent bdf9c14a
Loading
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment