diff --git a/data/queue.py b/data/queue.py index 289b99ada..a2a7ba879 100644 --- a/data/queue.py +++ b/data/queue.py @@ -185,7 +185,12 @@ class WorkQueue(object): def complete(self, completed_item): with self._transaction_factory(db): - completed_item_obj = self._item_by_id_for_update(completed_item.id) + try: + completed_item_obj = self._item_by_id_for_update(completed_item.id) + except QueueItem.DoesNotExist: + self._currently_processing = False + return + completed_item_obj.delete_instance(recursive=True) self._currently_processing = False diff --git a/workers/diffsworker.py b/workers/diffsworker.py index 073bfbe9c..406e3564e 100644 --- a/workers/diffsworker.py +++ b/workers/diffsworker.py @@ -23,6 +23,12 @@ class DiffsWorker(QueueWorker): msg = ('Image does not exist in database \'%s\' for repo \'%s/\'%s\'' % (image_id, namespace, repository)) logger.warning(msg) + except IOError: + # This exception is unrecoverable, and the item should continue and be + # marked as complete. + msg = ("Data could not be retrieved for image %s under repo %s/%s" % + (image_id, namespace, repository)) + logger.exception(msg) return True