summaryrefslogtreecommitdiffstats
path: root/third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py')
-rw-r--r--third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py b/third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py
index 367b94e1de..e5477d35b7 100644
--- a/third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py
+++ b/third_party/python/taskcluster_taskgraph/taskgraph/optimize/base.py
@@ -271,14 +271,19 @@ def replace_tasks(
dependencies_of = target_task_graph.graph.links_dict()
for label in target_task_graph.graph.visit_postorder():
+ logger.debug(f"replace_tasks: {label}")
# if we're not allowed to optimize, that's easy..
if label in do_not_optimize:
+ logger.debug(f"replace_tasks: {label} is in do_not_optimize")
continue
# if this task depends on un-replaced, un-removed tasks, do not replace
if any(
l not in replaced and l not in removed_tasks for l in dependencies_of[label]
):
+ logger.debug(
+ f"replace_tasks: {label} depends on an unreplaced or unremoved task"
+ )
continue
# if the task already exists, that's an easy replacement
@@ -287,6 +292,7 @@ def replace_tasks(
label_to_taskid[label] = repl
replaced.add(label)
opt_counts["existing_tasks"] += 1
+ logger.debug(f"replace_tasks: {label} replaced from existing_tasks")
continue
# call the optimization strategy
@@ -304,14 +310,20 @@ def replace_tasks(
repl = opt.should_replace_task(task, params, deadline, arg)
if repl:
if repl is True:
+ logger.debug(f"replace_tasks: {label} removed by optimization strategy")
# True means remove this task; get_subgraph will catch any
# problems with removed tasks being depended on
removed_tasks.add(label)
else:
+ logger.debug(
+ f"replace_tasks: {label} replaced by optimization strategy"
+ )
label_to_taskid[label] = repl
replaced.add(label)
opt_counts[opt_by] += 1
continue
+ else:
+ logger.debug(f"replace_tasks: {label} kept by optimization strategy")
_log_optimization("replaced", opt_counts)
return replaced