Handle case where etcd key is already removed on job complete

This commit is contained in:
Joseph Schorr 2015-06-17 15:02:58 -04:00
parent 99dff912af
commit c2dc1c9b75

View file

@ -329,7 +329,7 @@ class EphemeralBuilderManager(BaseManager):
job.job_details['build_uuid'], build_component.builder_realm)
yield From(build_component.start_build(job))
except (KeyError, etcd.EtcdKeyError):
logger.debug('Builder is asking for more work, but work already completed')
logger.exception('Builder is asking for more work, but work already completed')
def build_component_disposed(self, build_component, timed_out):
logger.debug('Calling build_component_disposed.')
@ -344,7 +344,10 @@ class EphemeralBuilderManager(BaseManager):
# Release the lock in etcd
job_key = self._etcd_job_key(build_job)
yield From(self._etcd_client.delete(job_key))
try:
yield From(self._etcd_client.delete(job_key))
except (KeyError, etcd.EtcdKeyError):
logger.exception('Builder is asking for job to be removed, but work already completed')
self.job_complete_callback(build_job, job_status)