Fix bug allowing concurrent execution of jobs in the same queue.

There was an issue where a higher priority job in the same queue would
become the new most eligible job, even if the current most eligible job
was actively running.
This commit is contained in:
Greyson Parrelli
2026-04-24 13:26:12 +00:00
parent 572c11ee6d
commit 799e57dbe9
2 changed files with 24 additions and 0 deletions
@@ -492,6 +492,10 @@ class FastJobStorage(private val jobDatabase: JobDatabase) : JobStorage {
private fun placeJobInEligibleList(jobCandidate: MinimalJobSpec) {
val existingJobInQueue = jobCandidate.queueKey?.let { mostEligibleJobForQueue[it] }
if (existingJobInQueue != null) {
if (existingJobInQueue.isRunning) {
return
}
if (jobCandidate.globalPriority < existingJobInQueue.globalPriority) {
return
}