Skip to content

Commit

Permalink
Don't return prematurely if parent task is still open.
Browse files Browse the repository at this point in the history
@robert-scheck hit this here:
fedora-infra/fmn#54 (comment)

There is a parent build which had one task:
   That task had three child tasks
        srpmfromscm
        buildarch
        tagbuild

All three grandchild tasks were done and koji published a fedmsg message
about it, but the middle-parent task had not yet become 'closed'.  FMN
tried to get the 'results' of the middle-parent task, but when that task
is still 'open', this throws an exception.

We can handle that exception, but we returned prematurely from the
``_fill_task_template`` method, returning before we had a chance to
iterate over the grandchild tasks that have the most interesting
information (binary rpms, logs, etc).

This patch should avoid that premature return so we can cram as much
info as is available in our emails.
  • Loading branch information
ralphbean committed Feb 28, 2015
1 parent b030cf9 commit 1f80bf7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fedmsg_meta_fedora_infrastructure/buildsys.py
Expand Up @@ -73,7 +73,7 @@ def _fill_task_template(cls, sess, taskid):
result = sess.getTaskResult(taskid)
except Exception as e:
log.warning(unicode(e))
return retval + "\n" + unicode(e) + "\n"
retval += "\n" + unicode(e) + "\n"

if result:
for kind in ['logs', 'rpms', 'srpms']:
Expand All @@ -89,6 +89,7 @@ def _fill_task_template(cls, sess, taskid):
children = sess.getTaskChildren(taskid)
for child in sorted(children, key=lambda d: d['completion_ts']):
retval += "\n" + cls._fill_task_template(sess, child['id'])

return retval

@classmethod
Expand Down

0 comments on commit 1f80bf7

Please sign in to comment.