Bug 1401725 - Catch HTTP 404 errors during taskgraph optimization; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Thu, 21 Sep 2017 07:52:03 -0700
changeset 668370 2d282a1200e107dc6cfca9edf0677815714bbb8b
parent 667790 469eb992a9d166004f2601ce725786f671219054
child 668371 488ed7afe6cd1e86a27546fdeb22c600d4bd7c1b
push id81018
push usergszorc@mozilla.com
push dateThu, 21 Sep 2017 14:52:38 +0000
reviewersdustin
bugs1401725
milestone57.0a1
Bug 1401725 - Catch HTTP 404 errors during taskgraph optimization; r?dustin find_task_id() converts HTTP 404 to KeyError. So we need to trap an additional exception to handle this failure. MozReview-Commit-ID: IMHAxpT1dmt
taskcluster/taskgraph/optimize.py
--- a/taskcluster/taskgraph/optimize.py
+++ b/taskcluster/taskgraph/optimize.py
@@ -170,17 +170,18 @@ def optimization(name):
 @optimization('index-search')
 def opt_index_search(task, params, index_path):
     try:
         task_id = find_task_id(
             index_path,
             use_proxy=bool(os.environ.get('TASK_ID')))
 
         return task_id or True
-    except requests.exceptions.HTTPError:
+    # find_task_id() converts HTTP 404 to KeyError.
+    except (KeyError, requests.exceptions.HTTPError):
         pass
 
     return False
 
 
 @optimization('seta')
 def opt_seta(task, params):
     bbb_task = False