Retry jobs after gear disconnect
If Zuul is disconnected from gearman, have Zuul retry the job.
Also, report slightly more useful status words for various kinds
of failures when able.
Change-Id: I2d0f2986199516f6251bb122ab619ac56a87ee8e
diff --git a/zuul/launcher/gearman.py b/zuul/launcher/gearman.py
index 077992a..3a690dc 100644
--- a/zuul/launcher/gearman.py
+++ b/zuul/launcher/gearman.py
@@ -298,7 +298,7 @@
if not self.isJobRegistered(gearman_job.name):
self.log.error("Job %s is not registered with Gearman" %
gearman_job)
- self.onBuildCompleted(gearman_job, 'LOST')
+ self.onBuildCompleted(gearman_job, 'NOT_REGISTERED')
return build
if pipeline.precedence == zuul.model.PRECEDENCE_NORMAL:
@@ -312,14 +312,14 @@
self.gearman.submitJob(gearman_job, precedence=precedence)
except Exception:
self.log.exception("Unable to submit job to Gearman")
- self.onBuildCompleted(gearman_job, 'LOST')
+ self.onBuildCompleted(gearman_job, 'EXCEPTION')
return build
if not gearman_job.handle:
self.log.error("No job handle was received for %s after 30 seconds"
" marking as lost." %
gearman_job)
- self.onBuildCompleted(gearman_job, 'LOST')
+ self.onBuildCompleted(gearman_job, 'NO_HANDLE')
return build
@@ -396,7 +396,7 @@
def onDisconnect(self, job):
self.log.info("Gearman job %s lost due to disconnect" % job)
- self.onBuildCompleted(job, 'LOST')
+ self.onBuildCompleted(job)
def onUnknownJob(self, job):
self.log.info("Gearman job %s lost due to unknown handle" % job)