Bug 1383880: handle keyError from find_task_id; r=gps
authorDustin J. Mitchell <dustin@mozilla.com>
Thu, 21 Sep 2017 12:02:44 +0000
changeset 435462 b0d1cd898a0ba193cd06ec9987754176ca381e97
parent 435461 0aa93d9b53a9c42d361ff978b9dcb537ab33d8c5
child 435463 fc2264fce0d40ca7c1ac7daa1fb59e4c3f59bffa
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1383880
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 1383880: handle keyError from find_task_id; r=gps MozReview-Commit-ID: F3mVgKcqZwA
python/mozbuild/mozbuild/artifacts.py
taskcluster/taskgraph/optimize.py
--- a/python/mozbuild/mozbuild/artifacts.py
+++ b/python/mozbuild/mozbuild/artifacts.py
@@ -653,17 +653,17 @@ class TaskCache(CacheManager):
             product=artifact_job.product,
             job=job,
         )
         self.log(logging.DEBUG, 'artifact',
                  {'namespace': namespace},
                  'Searching Taskcluster index with namespace: {namespace}')
         try:
             taskId = find_task_id(namespace)
-        except Exception:
+        except KeyError:
             # Not all revisions correspond to pushes that produce the job we
             # care about; and even those that do may not have completed yet.
             raise ValueError('Task for {namespace} does not exist (yet)!'.format(namespace=namespace))
 
         artifacts = list_artifacts(taskId)
 
         urls = []
         for artifact_name in artifact_job.find_candidate_artifacts(artifacts):
--- a/taskcluster/taskgraph/optimize.py
+++ b/taskcluster/taskgraph/optimize.py
@@ -10,17 +10,16 @@ task.
 
 See ``taskcluster/docs/optimization.rst`` for more information.
 """
 
 from __future__ import absolute_import, print_function, unicode_literals
 
 import logging
 import os
-import requests
 from collections import defaultdict
 
 from .graph import Graph
 from . import files_changed
 from .taskgraph import TaskGraph
 from .util.seta import is_low_value_task
 from .util.taskcluster import find_task_id
 from .util.parameterization import resolve_task_references
@@ -302,17 +301,17 @@ class IndexSearch(OptimizationStrategy):
     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')))
                 return task_id
-            except requests.exceptions.HTTPError:
+            except KeyError:
                 # 404 will end up here and go on to the next index path
                 pass
 
         return False
 
 
 class SETA(OptimizationStrategy):
     def should_remove_task(self, task, params, _):