Don't cancel subtask when other fails

In some cases it makes sense to continue with sibling task even if some of
them already failed. E.g. with kernel build it could be of use if submitter
knows for which archs it succeed and for which it fails. Repeated builds
could take a lot of time and resources.

Option is turned on by 'build_arch_can_fail' in kojid.conf and it is turned
on per builder. Note, that it shouldn't be enabled by default as it could
result in unnecessary resource consumption.
This commit is contained in:
Tomas Kopecek 2016-09-30 14:18:03 +02:00 committed by Mike McLean
parent 3bd647ae21
commit eaa0943a1a
2 changed files with 7 additions and 2 deletions

View file

@ -979,7 +979,8 @@ class BuildTask(BaseTaskHandler):
self.logger.debug("Waiting on subtasks...")
# wait for subtasks to finish
results = self.wait(subtasks.values(), all=True, failany=True)
failany = not getattr(self.options, 'build_arch_can_fail', False)
results = self.wait(subtasks.values(), all=True, failany=failany)
# finalize import
# merge data into needed args for completeBuild call
@ -4999,7 +5000,8 @@ def get_options():
quit("value for %s option must be a valid integer" % name)
elif name in ['offline_retry', 'use_createrepo_c', 'createrepo_skip_stat',
'createrepo_update', 'keepalive', 'use_fast_upload',
'support_rpm_source_layout', 'krb_rdns']:
'support_rpm_source_layout', 'krb_rdns',
'build_arch_can_fail']:
defaults[name] = config.getboolean('kojid', name)
elif name in ['plugin', 'plugins']:
defaults['plugin'] = value.split()

View file

@ -86,3 +86,6 @@ from_addr=Koji Build System <buildsys@example.com>
;certificate of the CA that issued the HTTP server certificate
;serverca = /etc/kojid/serverca.crt
;if set to True, failing subtask will not automatically cancel other siblings
;build_arch_can_fail = True