Bug 1573269: make g-w tasks support retry-exit-status r=tomprince
authorAndrew Erickson <aerickson@mozilla.com>
Thu, 17 Oct 2019 01:30:17 +0000
changeset 559394 5cef7916b0942202578803f86ffb6e3d7dbdb696
parent 559393 4f9c5948b03415734dcded1dfb029482379dfdf0
child 559395 650273d192077a93007e509e7d7ec6690d84ee87
push id12177
push usercsabou@mozilla.com
push dateMon, 21 Oct 2019 14:52:16 +0000
treeherdermozilla-beta@1918a9cd33bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstomprince
bugs1573269
milestone71.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 1573269: make g-w tasks support retry-exit-status r=tomprince Differential Revision: https://phabricator.services.mozilla.com/D49220
taskcluster/taskgraph/transforms/job/mozharness_test.py
taskcluster/taskgraph/transforms/task.py
--- a/taskcluster/taskgraph/transforms/job/mozharness_test.py
+++ b/taskcluster/taskgraph/transforms/job/mozharness_test.py
@@ -271,16 +271,17 @@ def mozharness_test_on_generic_worker(co
             worker['run-as-administrator'] = True
         else:
             raise Exception('run-as-administrator not supported on {}'.format(job['worker-type']))
 
     if test['reboot']:
         raise Exception('reboot: {} not supported on generic-worker'.format(test['reboot']))
 
     worker['max-run-time'] = test['max-run-time']
+    worker['retry-exit-status'] = test['retry-exit-status']
     worker['artifacts'] = artifacts
 
     env = worker.setdefault('env', {})
     env['GECKO_HEAD_REPOSITORY'] = config.params['head_repository']
     env['GECKO_HEAD_REV'] = config.params['head_rev']
 
     # this list will get cleaned up / reduced / removed in bug 1354088
     if is_macosx:
--- a/taskcluster/taskgraph/transforms/task.py
+++ b/taskcluster/taskgraph/transforms/task.py
@@ -772,16 +772,19 @@ def build_docker_worker_payload(config, 
 
     # feature for test task to run as administarotr
     Optional('run-as-administrator'): bool,
 
     # optional features
     Required('chain-of-trust'): bool,
     Optional('taskcluster-proxy'): bool,
 
+    # the exit status code(s) that indicates the task should be retried
+    Optional('retry-exit-status'): [int],
+
     # Wether any artifacts are assigned to this worker
     Optional('skip-artifacts'): bool,
 })
 def build_generic_worker_payload(config, task, task_def):
     worker = task['worker']
     features = {}
 
     task_def['payload'] = {
@@ -793,16 +796,19 @@ def build_generic_worker_payload(config,
         task_def['payload']['onExitStatus'] = {
             'retry': [
                 # These codes (on windows) indicate a process interruption,
                 # rather than a task run failure. See bug 1544403.
                 1073807364,  # process force-killed due to system shutdown
                 3221225786,  # sigint (any interrupt)
             ]
         }
+    if 'retry-exit-status' in worker:
+        task_def['payload'].setdefault(
+            'onExitStatus', {}).setdefault('retry', []).extend(worker['retry-exit-status'])
 
     env = worker.get('env', {})
 
     if task.get('needs-sccache'):
         features['taskclusterProxy'] = True
         task_def['scopes'].append(
             'assume:project:taskcluster:{trust_domain}:level-{level}-sccache-buckets'.format(
                 trust_domain=config.graph_config['trust-domain'],