Handle failed jobs with no results.

If we get a WORK_FAIL or WORK_EXCEPTION with no preceding WORK_DATA
packet with a result, record the result as LOST.

This can happen if Jenkins encounters an exception while running
the job.

Change-Id: I159248e228af4e67ba6c88282346f366592e0d37
Reviewed-on: https://review.openstack.org/32814
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
James E. Blair 2013-06-12 16:37:31 -07:00 committed by Jenkins
parent 701c5b4767
commit 869b12acb6
1 changed files with 7 additions and 0 deletions

View File

@ -72,6 +72,11 @@ class ZuulGearmanClient(gear.Client):
self.__zuul_gearman.onBuildCompleted(job)
return job
def handleWorkException(self, packet):
job = super(ZuulGearmanClient, self).handleWorkException(packet)
self.__zuul_gearman.onBuildCompleted(job)
return job
def handleWorkStatus(self, packet):
job = super(ZuulGearmanClient, self).handleWorkStatus(packet)
self.__zuul_gearman.onWorkStatus(job)
@ -336,6 +341,8 @@ class Gearman(object):
if result is None:
data = getJobData(job)
result = data.get('result')
if result is None:
result = 'LOST'
self.log.info("Build %s complete, result %s" %
(job, result))
build.result = result