Bug 1372892: make tasks with optimized dependencies depend on decision task; r=Callek

This addresses the issue where tasks with a dependency which is already
complete started immediately, without waiting for the decision task (bug
1372817).

It does not address the issue where a re-run of a failed decision task will
allow tasks created by the first run to run, in addition to creating an
entirely new set of tasks.

MozReview-Commit-ID: EdNZSrNw3F6

--HG--
extra : rebase_source : 1b356d5c59e9b5693bcc8b5e34f446d4feb4a78b
This commit is contained in:
Dustin J. Mitchell 2017-07-01 17:01:42 -04:00
Родитель f6b7696c2d
Коммит cba9dc518a
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -60,11 +60,15 @@ def create_tasks(taskgraph, label_to_taskid, params):
for task_id in taskgraph.graph.visit_postorder():
task_def = taskgraph.tasks[task_id].task
attributes = taskgraph.tasks[task_id].attributes
# if this task has no dependencies, make it depend on this decision
# task so that it does not start immediately; and so that if this loop
# fails halfway through, none of the already-created tasks run.
if decision_task_id and not task_def.get('dependencies'):
task_def['dependencies'] = [decision_task_id]
# if this task has no dependencies *within* this taskgraph, make it
# depend on this decision task. If it has another dependency within
# the taskgraph, then it already implicitly depends on the decision
# task. The result is that tasks do not start immediately. if this
# loop fails halfway through, none of the already-created tasks run.
if decision_task_id:
if not any(t in taskgraph.tasks for t in task_def.get('dependencies', [])):
task_def.setdefault('dependencies', []).append(decision_task_id)
task_def['taskGroupId'] = task_group_id
task_def['schedulerId'] = scheduler_id