Cleanup failed upload records
Failed uploads happen when things like clouds disappearing happen. This then results in hundreds or even thousands of upload records all failed while we wait for the cloud to return. THis is noise that makes it hard to debug actual problems with image uploads as you can't easily see what is current. Avoid this noise in output by cleaning up Failed records after they have been recorded. Change-Id: Ife0cf3dd0d9af6cf7a587e9906726c67271b0d5c
This commit is contained in:
parent
6e34b65d62
commit
84336a4d3c
@ -367,7 +367,9 @@ class CleanupWorker(BaseWorker):
|
||||
marked for deleting.
|
||||
'''
|
||||
cruft = self._zk.getUploads(image, build_id, provider,
|
||||
states=[zk.UPLOADING, zk.DELETING])
|
||||
states=[zk.UPLOADING,
|
||||
zk.DELETING,
|
||||
zk.FAILED])
|
||||
for upload in cruft:
|
||||
if (upload.state == zk.UPLOADING and
|
||||
not self._inProgressUpload(upload)
|
||||
@ -385,6 +387,9 @@ class CleanupWorker(BaseWorker):
|
||||
elif upload.state == zk.DELETING:
|
||||
self.log.info("Removing deleted upload and record: %s" % upload)
|
||||
self._deleteUpload(upload)
|
||||
elif upload.state == zk.FAILED:
|
||||
self.log.info("Removing failed upload and record: %s" % upload)
|
||||
self._deleteUpload(upload)
|
||||
|
||||
def _cleanupImage(self, known_providers, image):
|
||||
'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user