Bug 1405570 - Never remove tasks with an index-search optimization. r=dustin
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 05 Oct 2017 10:36:32 +0900
changeset 385614 5b8fb23f16afc92457ce0703eb0d4367279727b9
parent 385613 22eeb805d31ce68662d16f27fef52e99216c70b4
child 385615 b9dd71f3f20f077171eddb8f20d1683701ef24e5
push id53108
push usermh@glandium.org
push dateWed, 11 Oct 2017 21:42:53 +0000
treeherderautoland@5b8fb23f16af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1405570
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1405570 - Never remove tasks with an index-search optimization. r=dustin
taskcluster/taskgraph/optimize.py
--- a/taskcluster/taskgraph/optimize.py
+++ b/taskcluster/taskgraph/optimize.py
@@ -289,19 +289,26 @@ class OnlyIfDependenciesRun(Optimization
     # should_replace_task is called, then a task has no un-optimized
     # dependencies and can be removed (indicated by returning True)
 
     def should_replace_task(self, task, params, arg):
         return True
 
 
 class IndexSearch(OptimizationStrategy):
-    def should_remove_task(self, task, params, index_paths):
-        "If this task has no dependencies, don't run it.."
-        return True
+
+    # A task with no dependencies remaining after optimization will be replaced
+    # if artifacts exist for the corresponding index_paths.
+    # Otherwise, we're in one of the following cases:
+    # - the task has un-optimized dependencies
+    # - the artifacts have expired
+    # - some changes altered the index_paths and new artifacts need to be
+    # created.
+    # In every of those cases, we need to run the task to create or refresh
+    # artifacts.
 
     def should_replace_task(self, task, params, index_paths):
         "Look for a task with one of the given index paths"
         for index_path in index_paths:
             try:
                 task_id = find_task_id(
                     index_path,
                     use_proxy=bool(os.environ.get('TASK_ID')))