Catch additional key not found exception

Fixes #806
This commit is contained in:
Joseph Schorr 2015-12-01 12:24:17 -05:00
parent cc80e87ef4
commit edd9a03af5

View file

@ -413,7 +413,13 @@ class EphemeralBuilderManager(BaseManager):
def job_heartbeat(self, build_job):
# Extend the deadline in etcd
job_key = self._etcd_job_key(build_job)
build_job_metadata_response = yield From(self._etcd_client.read(job_key))
try:
build_job_metadata_response = yield From(self._etcd_client.read(job_key))
except (KeyError, etcd.EtcdKeyError):
logger.error('Job %s not longer exists in etcd', build_job.job_details['build_uuid'])
return
build_job_metadata = json.loads(build_job_metadata_response.value)
max_expiration = datetime.utcfromtimestamp(build_job_metadata['max_expiration'])