diff options
author | Richard Hedlind <richard.hedlind@x-io.com> | 2015-12-18 13:45:58 -0700 |
---|---|---|
committer | Richard Hedlind <richard.hedlind@x-io.com> | 2015-12-18 13:53:08 -0700 |
commit | 13cb40c3a076ba78edc5e35729c6bd7ef38ff9bb (patch) | |
tree | bcad6a5003252c52abca9a2a8aa9618885a097c9 /zuul/scheduler.py | |
parent | 257cc7e1f9dbf4884debdb0884a61074bb8860a0 (diff) | |
download | zuul-13cb40c3a076ba78edc5e35729c6bd7ef38ff9bb.tar.gz |
Add exception handler to updateBuildDescriptions
Adding a exception handler to updateBuildDescriptions to
handle exceptions from launcher (Gearman).
This addresses the corner case seen in:
https://storyboard.openstack.org/#!/story/2000445
In the above mentioned corner case, Gearman throws a communication
error exception. Since updateBuildDescriptions is called after the
build status has been reported to Gerrit, we want to make sure that
we return back to caller so that the build is properly marked as
reported in reportItem to avoid an infinite loop.
Change-Id: I166d4a2e1d45e97a9ed0b6addb7270e1bf92d6f7
Diffstat (limited to 'zuul/scheduler.py')
-rw-r--r-- | zuul/scheduler.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py index f8321d14e..151aae14e 100644 --- a/zuul/scheduler.py +++ b/zuul/scheduler.py @@ -1535,13 +1535,23 @@ class BasePipelineManager(object): def updateBuildDescriptions(self, build_set): for build in build_set.getBuilds(): - desc = self.formatDescription(build) - self.sched.launcher.setBuildDescription(build, desc) + try: + desc = self.formatDescription(build) + self.sched.launcher.setBuildDescription(build, desc) + except: + # Log the failure and let loop continue + self.log.error("Failed to update description for build %s" % + (build)) if build_set.previous_build_set: for build in build_set.previous_build_set.getBuilds(): - desc = self.formatDescription(build) - self.sched.launcher.setBuildDescription(build, desc) + try: + desc = self.formatDescription(build) + self.sched.launcher.setBuildDescription(build, desc) + except: + # Log the failure and let loop continue + self.log.error("Failed to update description for " + "build %s in previous build set" % (build)) def onBuildStarted(self, build): self.log.debug("Build %s started" % build) |