Produce better errors on startup if cat jobs fail

If a cat job times out, it has no 'updated' attribute, so the
job.updated check fails with an attribute error.  Instead, detect
that case and report a useful error message to users so they know
why Zuul just failed to start.

Change-Id: I0822bdb6bd425494d323538d0c598e8b1a0c727a
This commit is contained in:
James E. Blair 2021-05-06 17:02:45 -07:00
parent de00c44021
commit 28916c741b
1 changed files with 4 additions and 0 deletions

View File

@ -1840,6 +1840,10 @@ class TenantParser(object):
for job in jobs:
self.log.debug("Waiting for cat job %s" % (job,))
job.wait(self.merger.git_timeout)
if not hasattr(job, 'updated'):
# We timed out
raise Exception("Cat job %s timed out; consider setting "
"merger.git_timeout in zuul.conf" % (job,))
if not job.updated:
raise Exception("Cat job %s failed" % (job,))
self.log.debug("Cat job %s got files %s" %