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
This commit is contained in:
Richard Hedlind 2015-12-18 13:45:58 -07:00
parent 257cc7e1f9
commit 13cb40c3a0
1 changed files with 14 additions and 4 deletions

View File

@ -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)