mirror of https://github.com/minio/minio.git
do not return an error in AbortMultipartUpload() (#18135)
returning an error is a bit undefined in AWS S3 as it may return an error or not depending on the time from AbortMultipartUpload().
This commit is contained in:
parent
c34bdc33fb
commit
d6446cb096
|
@ -1248,7 +1248,11 @@ func (er erasureObjects) CompleteMultipartUpload(ctx context.Context, bucket str
|
|||
}
|
||||
}
|
||||
|
||||
defer er.deleteAll(context.Background(), minioMetaMultipartBucket, uploadIDPath)
|
||||
defer func() {
|
||||
if err == nil {
|
||||
er.deleteAll(context.Background(), minioMetaMultipartBucket, uploadIDPath)
|
||||
}
|
||||
}()
|
||||
|
||||
// Rename the multipart object to final location.
|
||||
onlineDisks, versionsDisparity, err := renameData(ctx, onlineDisks, minioMetaMultipartBucket, uploadIDPath,
|
||||
|
|
|
@ -1075,9 +1075,14 @@ func (api objectAPIHandlers) AbortMultipartUploadHandler(w http.ResponseWriter,
|
|||
}
|
||||
opts := ObjectOptions{}
|
||||
if err := abortMultipartUpload(ctx, bucket, object, uploadID, opts); err != nil {
|
||||
switch err.(type) {
|
||||
case InvalidUploadID:
|
||||
// Do not have return an error for non-existent upload-id
|
||||
default:
|
||||
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
writeSuccessNoContent(w)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue