Skip to content
Snippets Groups Projects
Commit ae9c3cef authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[backend] Lock splits which are currently being started

parent 3798db45
No related branches found
No related tags found
1 merge request!194Scheduler
Pipeline #
......@@ -424,8 +424,9 @@ class Worker(models.Model):
if settings.DEBUG: cmdline += ['-vv']
# start newly assigned job splits
for split in JobSplit.objects.filter(worker=self, status=Job.QUEUED,
start_date__isnull=True, process_id__isnull=True):
for split in JobSplit.objects.select_for_update().filter(worker=self,
status=Job.QUEUED, start_date__isnull=True,
process_id__isnull=True):
execute = pick_execute(split, environments)
if execute is None:
message = "Environment `%s' is not available for split " \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment