From ddb1ed74417cc8549426caed63a8063858207bd2 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 11 Oct 2017 15:55:35 -0400 Subject: [PATCH] Also delete the job key when expiring a job Otherwise, we can't requeue the job --- buildman/manager/ephemeral.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 1f24f9303..295ff06dd 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -170,6 +170,13 @@ class EphemeralBuilderManager(BaseManager): got_lock = yield From(self._take_etcd_atomic_lock('job-expired', build_job.build_uuid, execution_id)) if got_lock: + try: + # Clean up the bookkeeping for the job. + yield From(self._etcd_client.delete(self._etcd_job_key(build_job))) + except (KeyError, etcd.EtcdKeyError): + logger.debug('Could not delete job key %s; might have been removed already', + build_job.build_uuid) + logger.error('[BUILD INTERNAL ERROR] Build ID: %s. Exec name: %s. Exec ID: %s', build_job.build_uuid, executor_name, execution_id) yield From(self.job_complete_callback(build_job, BuildJobResult.INCOMPLETE, executor_name,