Return an error on failed S3 uploads
The previous change to this file didn't raise the error up to stream_write, and so the complete_upload function still ran because the loop was only broken. It errored because the data was already canceled. This is better than what we had before, which was to silently fail but report success (even internally to ourselves!) on bad image upload. This means we discovered a bug where a user could have failed during image upload, but quay would write that image to the repository, potentially writing broken images to S3.
This commit is contained in:
parent
62ea4a6cf4
commit
a821ad2b01
2 changed files with 7 additions and 2 deletions
|
@ -167,7 +167,8 @@ class _CloudStorage(BaseStorage):
|
|||
except IOError:
|
||||
app.metric_queue.put('MultipartUploadFailure', 1)
|
||||
mp.cancel_upload()
|
||||
break
|
||||
raise
|
||||
|
||||
app.metric_queue.put('MultipartUploadSuccess', 1)
|
||||
mp.complete_upload()
|
||||
|
||||
|
|
Reference in a new issue